Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a problem with uninstalling dovecot. And while trying to fix it I made it way worse. Here is the "log":

Errors were encountered while processing:
 dovecot-imapd
 dovecot-pop3d
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@gasimzada:/usr/lib# apt-get remove -f dovecot-imapd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  dovecot-imapd dovecot-pop3d
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 976 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 43903 files and directories currently installed.)
Removing dovecot-imapd ...
doveconf: error while loading shared libraries: libdovecot.so.0: cannot open shared object file: No such file or directory
[....] Starting IMAP/POP3 mail server: dovecot/usr/sbin/dovecot: error while loading shared libraries: libdovecot.so.0: cannot open shared object file: No such file or directory
 failed!
invoke-rc.d: initscript dovecot, action "start" failed.
dpkg: error processing dovecot-imapd (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing dovecot-pop3d ...
doveconf: error while loading shared libraries: libdovecot.so.0: cannot open shared object file: No such file or directory
[....] Starting IMAP/POP3 mail server: dovecot/usr/sbin/dovecot: error while loading shared libraries: libdovecot.so.0: cannot open shared object file: No such file or directory
 failed!
invoke-rc.d: initscript dovecot, action "start" failed.
dpkg: error processing dovecot-pop3d (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 dovecot-imapd
 dovecot-pop3d
E: Sub-process /usr/bin/dpkg returned an error code (1)

The reason there is an error is because I removed the dovecot folder from /usr/lib which was a horrible idea. Whats an alternative to removing an package without making the package run?

Thanks,

share|improve this question

Option a)

Reinstall the package, and immediately afterwards remove it.

Option b)

tweak the post-rm script file so that it does not call doveconf.

Option c)

tweak doveconf itself so it is a clone of /bin/true.

share|improve this answer
    
i force deleted it using dpkg and it worked :D – Gasim Dec 8 '13 at 14:25

Reinstalling / uninstalling/ purging did not work for me. This did:

This worked for me:

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

:-)

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .