如何在 Ubuntu 10.04 上修复此错误?
Reading package lists... Done
Building dependency tree
Reading state information... Done
postfix is already the newest version.
The following packages were automatically installed and are no longer required:
libaprutil1-dbd-sqlite3 libcap2 apache2.2-bin libapr1 libaprutil1-ldap libaprutil1 php5-common
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
1 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Setting up postfix (2.7.0-1) ...
Postfix configuration was not changed. If you need to make changes, edit
/etc/postfix/main.cf (and others) as needed. To view Postfix configuration
values, see postconf(1).
After modifying main.cf, be sure to run '/etc/init.d/postfix reload'.
Running newaliases
newaliases: warning: valid_hostname: numeric hostname: 202002
newaliases: fatal: file /etc/postfix/main.cf: parameter myhostname: bad parameter value: 202002
dpkg: error processing postfix (--configure):
subprocess installed post-installation script returned error exit status 75
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Errors were encountered while processing:
postfix
E: Sub-process /usr/bin/dpkg returned an error code (1)
即使我重新启动,也会出现相同的错误。谢谢您的帮助。
答案1
它清楚地表明错误在 /etc/postfix/main.cf 中。打开它并修复myhostname
值以匹配hostname
命令。然后运行service postfix reload
并检查它的情况。
答案2
这可能是由于首次安装时配置了无效的主机名debconf
而导致的。系统会将这些值保存在数据库中,并将它们用于将来的安装(我猜?),即使您删除或/和清除了您的 postfix,也会导致此问题。
尝试使用以下命令清除您的配置echo PURGE | debconf-communicate postfix
,然后重试apt-get install postfix
。