Ubuntu Error while installing postfix

sudo apt-get install postfix

 gives the following issue:

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)

 

I looked up other similar posts like this and the error seems to be the '..'in the hostname but whenever I remove it and change the name to timber, reload it and then retry installing postfix, it reverts the name back to timber..name and I get the same error again. 

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)

 I'm not sure how to permanantly change the name or in any case to remove the error. Now, whenever I try to install any package I get errors because of postfix.

Answer

  • Run sudo nano /etc/postfix/main.cf
  • Find the line hostname =
  • Change it:

From:
myhostname = timber..name
To:
myhostname = timber.name (ie. remove the extra dot, instead of both)

Finally, run sudo apt install --fix-broken
Hope it helps.

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值