3

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,

3 Answers 3

5

This uninstalls dovecot in debian:

systemctl stop dovecot
systemctl disable dovecot
apt-get purge dovecot-core
apt-get autoremove dovecot-core
2

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.

1
  • i force deleted it using dpkg and it worked :D
    – Gasim
    Commented Dec 8, 2013 at 14:25
1

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

:-)

0

You must log in to answer this question.

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