일부 패키지가 손상되었을 때 새 패키지를 설치하는 방법은 무엇입니까?

일부 패키지가 손상되었을 때 새 패키지를 설치하는 방법은 무엇입니까?

내 운영 체제는 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

이렇게 하면 스크립트는 성공적으로 종료하는 것 외에는 아무 작업도 수행하지 않습니다. 그런 다음 제거하면 됩니다.

관련 정보