
Ich habe ein Problem mit der Deinstallation von Dovecot. Und beim Versuch, es zu beheben, habe ich es noch schlimmer gemacht. Hier ist das „Protokoll“:
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)
Der Grund für den Fehler ist, dass ich den Dovecot-Ordner aus /usr/lib entfernt habe, was eine furchtbare Idee war. Was ist eine Alternative zum Entfernen eines Pakets, ohne das Paket auszuführen?
Danke,
Antwort1
Dies deinstalliert Dovecot in Debian:
systemctl stop dovecot
systemctl disable dovecot
apt-get purge dovecot-core
apt-get autoremove dovecot-core
Antwort2
Option a)
Installieren Sie das Paket neu und entfernen Sie es sofort danach.
Option b)
Optimieren Sie die Post-RM-Skriptdatei, sodass sie Doveconf nicht aufruft.
Option c)
Optimieren Sie Doveconf selbst, sodass es ein Klon von /bin/true ist.
Antwort3
Neuinstallation/Deinstallation/Löschen hat bei mir nicht funktioniert. Das hier hat funktioniert:
Das hat bei mir funktioniert:
sudo nano /etc/init.d/dovecot
setze exit 0 in die oberste Zeile (du kannst es auch in die 2. Zeile nach dem Kommentar schreiben), speichere und versuche mit aptitude-remove deine defekte Installation zu entfernen
:-)