首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >主机名:不知道的名称或服务

主机名:不知道的名称或服务
EN

Unix & Linux用户
提问于 2016-02-16 22:04:53
回答 1查看 11.9K关注 0票数 1

在安装两个软件包时,我得到了这个错误。

代码语言:javascript
复制
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:~#
EN

回答 1

Unix & Linux用户

回答已采纳

发布于 2016-02-16 22:18:44

问题是在/etc/hostname中输入的值与/etc/hosts中的任何条目不匹配。

这会导致命令hostname --fqdn返回一个无法解析的主机名,这将导致ssmtp没有安装。

确保将机器的主机名添加到/etc/hosts中。

与之相关的bug:

票数 4
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/263706

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档