
我在卸載 dovecot 時遇到問題。當我試圖解決這個問題時,我卻讓事情變得更糟。這是“日誌”:
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)
出現錯誤的原因是因為我從 /usr/lib 中刪除了 dovecot 資料夾,這是一個可怕的想法。除了刪除包而不使包運行之外,還有什麼其他方法嗎?
謝謝,
答案1
這會在 debian 中卸載 dovecot:
systemctl stop dovecot
systemctl disable dovecot
apt-get purge dovecot-core
apt-get autoremove dovecot-core
答案2
選項一)
重新安裝該軟體包,然後立即將其刪除。
選項 b)
調整 post-rm 腳本文件,使其不呼叫 doveconf。
選項c)
調整 doveconf 本身,使其成為 /bin/true 的克隆。
答案3
重新安裝/卸載/清除對我不起作用。這做到了:
這對我有用:
須藤奈米 /etc/init.d/dovecot
將 exit 0 放在頂行(您可以將其放在註釋後的第二行)保存,然後嘗試 aptitude-remove 刪除損壞的安裝
:-)