How to Completely Erase Postfix

How to Completely Erase Postfix

I install Postfix on my Ubuntu server 18.04

I modified the configuration of the file /etc/postfix/main.cf

I made mistakes and I want to restore the original file. So I uninstalled Postfix :

$ sudo apt remove postfix && apt purge postfix
$ sudo autoremove

When I install Postfix again, the installation does not ask the questions like on the first installation. I still have my previous configuration. Why can not I reset the Postfix configuration ?

If I reconfigure Postfix, I still have the previous configuration :

sudo dpkg-reconfigure postfix
5

1 Answer

To completely remove the package and all its configuration files:

sudo apt purge postfix

You can check if it's uninstalled by checking if the service is running:

systemctl status postfix

It then should say:

Unit postfix.service could not be found.

You can then reinstall it.

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Sarah Jenkins
Author

Sarah Jenkins

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.