sudo nano /etc/init.d/dovecot

sudo nano /etc/init.d/dovecot

Estou com um problema ao desinstalar o dovecot. E enquanto tentava consertar, tornei tudo ainda pior. Aqui está o "registro":

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)

O motivo do erro é porque removi a pasta dovecot de /usr/lib, o que foi uma ideia horrível. Qual é uma alternativa para remover um pacote sem executá-lo?

Obrigado,

Responder1

Isso desinstala o dovecot no debian:

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

Responder2

Opção a)

Reinstale o pacote e remova-o imediatamente.

Opção b)

ajuste o arquivo de script post-rm para que ele não chame o doveconf.

Opção c)

ajuste o próprio doveconf para que seja um clone de /bin/true.

Responder3

Reinstalar/desinstalar/limpar não funcionou para mim. Isso fez:

Isso funcionou para mim:

sudo nano /etc/init.d/dovecot

coloque exit 0 na linha superior (você pode colocá-lo na segunda linha após o comentário), salve e tente aptitude-remove para remover sua instalação quebrada

:-)

informação relacionada