Celeb Glow
updates | March 19, 2026

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

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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