一部のパッケージが破損したときに新しいパッケージをインストールする方法は?

一部のパッケージが破損したときに新しいパッケージをインストールする方法は?

私のオペレーティングシステムはdebian7.8です。破損したパッケージが見つかりました。完全にアンインストールして新しいパッケージをインストールするにはどうすればよいですか?

# apt-get install vim
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  vim-runtime
Suggested packages:
  ctags vim-doc vim-scripts
The following packages will be REMOVED:
  dovecot-imapd dovecot-pop3d
The following NEW packages will be installed:
  vim vim-runtime
0 upgraded, 2 newly installed, 2 to remove and 0 not upgraded.
2 not fully installed or removed.
Need to get 5,385 kB of archives.
After this operation, 23.8 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://mirrors.digitalocean.com/debian/ wheezy/main vim-runtime all 2:7.3.547-7 [4,607 kB]
Get:2 http://mirrors.digitalocean.com/debian/ wheezy/main vim i386 2:7.3.547-7 [778 kB]
Fetched 5,385 kB in 0s (5,884 kB/s)
(Reading database ... 50590 files and directories currently installed.)
Removing dovecot-imapd ...
[....] Starting IMAP/POP3 mail server: dovecotFatal: service(imap) access(/usr/lib/dovecot/imap) failed: 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 ...
[....] Starting IMAP/POP3 mail server: dovecotFatal: service(imap) access(/usr/lib/dovecot/imap) failed: 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)

パッケージをインストールできるようにこの問題を解決するにはどうすればよいですかvim

apt-get  remove  -f  dovecot  

It has no effct at all.

t@born:~# apt-get  remove  -f  dovecot
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'dovecot' is not installed, so not removed
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, 958 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 50529 files and directories currently installed.)
Removing dovecot-imapd ...
[....] Starting IMAP/POP3 mail server: dovecotFatal: service(auth) User doesn't exist: postfix (See service auth { unix_listener /var/spool/postfix/private/auth { user } } setting)
 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 ...
[....] Starting IMAP/POP3 mail server: dovecotFatal: service(auth) User doesn't exist: postfix (See service auth { unix_listener /var/spool/postfix/private/auth { user } } setting)
 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)

ベストアンサー1

希望の削除スタート何らかの理由でdovecotが失敗し、誤った設定で失敗します(postfixユーザーは参照されていますが、そのユーザーは存在しないようです)。

/etc/init.d/dovecotdovecotが実行されておらず、単に削除したい場合は、この場合は最初の行の下に行を追加することをお勧めします#! /bin/sh

exit 0

これにより、スクリプトは正常に終了する以外は何もしません。その後、削除してください。

おすすめ記事