在安装两个软件包时,我得到了这个错误。
root@blackbox:~# apt-get install mpack ssmtp
Reading package lists... Done
Building dependency tree
Reading state information... Done
mpack is already the newest version.
ssmtp is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up ssmtp (2.64-8) ...
hostname: Name or service not known
dpkg: error processing package ssmtp (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mailutils:
mailutils depends on default-mta | mail-transport-agent; however:
Package default-mta is not installed.
Package mail-transport-agent is not installed.
Package ssmtp which provides mail-transport-agent is not configured yet.
dpkg: error processing package mailutils (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
ssmtp
mailutils
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@blackbox:~#发布于 2016-02-16 22:18:44
问题是在/etc/hostname中输入的值与/etc/hosts中的任何条目不匹配。
这会导致命令hostname --fqdn返回一个无法解析的主机名,这将导致ssmtp没有安装。
确保将机器的主机名添加到/etc/hosts中。
与之相关的bug:
https://unix.stackexchange.com/questions/263706
复制相似问题