Automatic Postfix Updates Misconfiguration Reset on Ubuntu

Hi,

I used this straightforward article to set up automatic updates on my Ubuntu servers.

However, on the first server I tried it on, I chose the wrong option because the “Postfix Configuration” step was not mentioned/listed in the article. To go along with the steps of the article, I should have selected “No configuration” after step 2, but I actually selected “Internet Site”. Now I don’t see options to set the Unattended-Upgrade email and automatic-reboot settings. I tried rm’ing the /etc/apt/apt.conf.d/50unattended-upgrades file, but still not getting the Postfix Configuration when trying to re-install.

How can I reset/change the configuration back to the default “No configuration”? I am still learning, so my troubleshooting skills could use some work, but I don’t want to have to re-image the server and start over from scratch.

Thank you,

Dom

You need to use the dpkg-reconfigure command to see (get) re-configuration screens during the package installation on Debian/Ubuntu and co. Hence, for postfix re config after installation, run

sudo dpkg-reconfigure postfix

Is this what you want?

Perfect, thanks for the quick answer!

Hey @domsec we all start somewhere. Don’t worry about making mistakes…

If you ever want to remove those packages completely, pass the purge option that will remove config files. So from 2nd step instead of install you do --purge remove including postfix package:

sudo apt --purge remove unattended-upgrades apt-listchanges bsd-mailx postfix
sudo apt --purge autoremove

The autoremove is used to remove packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed as dependencies changed or the package(s) needing them were removed in the meantime.

Now all traces of all those packages gone including config. So now you can again start with step # 2 and you will get back all those prompts to select Postfix option. Just something I learned the hard way but not documented anywhere.


Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki