This is a little hacky (or tricky) move of how to remove your broken or not fully installed package in your Ubuntu Server box (I’m using Hardy).

You might face the same problem with me, when you want to remove package the aptitude states:

removing dovecot-common …
invoke-rc.d: initscript dovecot, action “stop” failed.
dpkg: error processing dovecot-common (–remove):
subprocess pre-removal script returned error exit status 1
invoke-rc.d: initscript dovecot, action “start” failed.
dpkg: error while cleaning up:
subprocess post-inistallation script returned error exit status 1
Errors were encountered while processing:
dovecot-common
E: errors …. bla bla bla

Even you cannot done a fresh install, it will states the same errors too.

You may fix the problems by using -f or –purge in your apt-remove command parameter, but if the command doesn’t work, try this:

# sudo nano /etc/init.d/dovecot
put exit 0 in the top line (you may put it on 2nd line after comment)
save, and try to aptitude-remove to remove your broken installation

It works! At least for me, excellent! 😉

Advertisements