sudo ナノ /etc/init.d/dovecot

sudo ナノ /etc/init.d/dovecot

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

オプションa)

パッケージを再インストールし、その後すぐに削除します。

オプションb)

doveconf を呼び出さないように、post-rm スクリプト ファイルを調整します。

オプションc)

doveconf 自体を /bin/true のクローンになるように調整します。

答え3

再インストール/アンインストール/削除は機能しませんでした。次の方法で機能しました:

これは私にとってはうまくいきました:

sudo ナノ /etc/init.d/dovecot

一番上の行に exit 0 と入力し(コメントの後の 2 行目でも可)、保存し、aptitude-remove を実行して壊れたインストールを削除してください。

:-)

関連情報