当某些软件包损坏时如何安装新软件包?

当某些软件包损坏时如何安装新软件包?

我的操作系统是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/dovecot如果 dovecot 没有运行并且您只是想删除它,那么我建议在这种情况下在第一行下方添加一行#! /bin/sh

exit 0

这样脚本除了成功退出之外不会执行任何操作。然后移除就可以了。

相关内容