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.