我正在尝试运行,sudo apt-get install -f
但是包似乎postfix
已损坏:
$ sudo apt-get install -f
[sudo] password for learner:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up postfix (2.11.0-1ubuntu1) ...
update-rc.d: /etc/init.d/postfix: file does not exist
dpkg: error processing package postfix (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
Errors were encountered while processing:
postfix
E: Sub-process /usr/bin/dpkg returned an error code (1)
但是我没有收到以下输出:
sudo dkpg --configure -a
我也遇到了这个错误:
$ sudo service postfix status
[sudo] password for learner:
postfix: unrecognized service
结果sudo apt-get purge(or autoremove) postfix:
learner@juggernaut:~$ sudo apt-get purge postfix
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
lsb-invalid-mta
The following packages will be REMOVED:
postfix*
The following NEW packages will be installed:
lsb-invalid-mta
0 upgraded, 1 newly installed, 1 to remove and 15 not upgraded.
1 not fully installed or removed.
Need to get 0 B/5,106 B of archives.
After this operation, 3,541 kB disk space will be freed.
Do you want to continue? [Y/n] y
dpkg: postfix: dependency problems, but removing anyway as you requested:
lsb-core depends on lsb-invalid-mta (>= 4.1+Debian11ubuntu6) | mail-transport-agent; however:
Package lsb-invalid-mta is not installed.
Package mail-transport-agent is not installed.
Package postfix which provides mail-transport-agent is to be removed.
(Reading database ... 228875 files and directories currently installed.)
Removing postfix (2.11.0-1ubuntu1) ...
invoke-rc.d: unknown initscript, /etc/init.d/postfix not found.
dpkg: error processing package postfix (--purge):
subprocess installed pre-removal script returned error exit status 100
Errors were encountered while processing:
postfix
E: Sub-process /usr/bin/dpkg returned an error code (1)
learner@juggernaut:~$
答案1
@AB 的评论解决了我的问题,并给出了答案:
sudo touch /etc/init.d/postfix; sudo apt-get purge postfix
答案2
您已成功运行apt-get install -f
并通知您:
0 个已升级,0 个已新安装,0 个已删除,15 个未升级。1 个未完全安装或删除。
因此,这里似乎有两条有价值的信息;第一,您当前安装的 15 个软件包可以升级;其次,您有一个软件包未正确或未完全安装;显然是 postfix。
首先,您应该更新您的软件包......
sudo apt-get update
其次是:
sudo apt-get dist-upgrade -u
也许现在您将能够配置已修复所有依赖问题的 Postfix......