sudo apt-get install postfix
给出了以下问题:
Setting up postfix (3.1.0-3ubuntu0.3) ...
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: misplaced delimiter: timber..name
newaliases: fatal: file /etc/postfix/main.cf: parameter myhostname: bad parameter value: timber..name
dpkg: error processing package postfix (--configure):
subprocess installed post-installation script returned error exit status 75
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Errors were encountered while processing:
postfix
E: Sub-process /usr/bin/dpkg returned an error code (1)
我查阅了其他类似的帖子这错误似乎是主机名中的“..”但每当我删除它并将名称更改为 木材,重新加载它,然后重试安装 postfix,它会将名称恢复为木材..名称我又遇到了同样的错误。
Setting up postfix (3.1.0-3ubuntu0.3) ...
setting myhostname=timber..name in /etc/postfix
Postfix is now set up with the changes above. 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: misplaced delimiter: timber..name
newaliases: fatal: file /etc/postfix/main.cf: parameter myhostname: bad parameter value: timber..name
dpkg: error processing package postfix (--configure):
subprocess installed post-installation script returned error exit status 75
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Errors were encountered while processing:
postfix
E: Sub-process /usr/bin/dpkg returned an error code (1)
我不知道如何永久更改名称或以任何方式消除错误。现在,每当我尝试安装任何软件包时,都会因为 postfix 而收到错误。
答案1
- 跑步
sudo nano /etc/postfix/main.cf
- 找到这条线
hostname =
- 更改:
从:
myhostname = timber..name
到:
myhostname = timber.name
(即删除多余的点,而不是同时删除两个点)
最后,运行sudo apt install --fix-broken
希望它有帮助。