Fixing Lighttpd Update Problem On Ubuntu
Posted by Vince Wadhwani on May 05, 2007
I've got a few servers still running Lighttpd. I found that the older version of lighttpd wouldn't update using synaptic, aptitude or the command line. I would always get an error:
* Stopping web server lighttpd
No /usr/sbin/lighttpd found running; none killed.
...fail!
invoke-rc.d: initscript lighttpd, action "stop" failed.
dpkg: warning - old pre-removal script returned error exit status 1
Now, Lighttpd and the rest of the server continued to function just fine, but it was stopping me from running my trusty sudo apt-get dist-upgrade and hence keeping my server secure. Nobody wants that!
Well, after some googling, I discovered that the easiest way to fix this is to head on over to your /var/lib/dpkg/info directory and edit the lighttpd.prerm file. What you want to do is comment out everything except the set -e.
Once you've done that, save your file, quit, and re-run your sudo apt-get dist-upgrade. It should now work fine! The best part is that, after you're done with your upgrade, your lighttpd.prerm file is restored to it's original beauty. Rock on!