如何彻底删除Postfix

a71*_*eb1 8 uninstall command-line postfix 18.04

我在 Ubuntu 服务器 18.04 上安装 Postfix

我修改了文件的配置/etc/postfix/main.cf

我犯了错误,我想恢复原始文件。所以我卸载了 Postfix :

$ sudo apt remove postfix && apt purge postfix
$ sudo autoremove
Run Code Online (Sandbox Code Playgroud)

当我再次安装 Postfix 时,安装不会像第一次安装时那样询问问题。我仍然保留着以前的配置。为什么我无法重置 Postfix 配置?

如果我重新配置 Postfix,我仍然有以前的配置:

sudo dpkg-reconfigure postfix
Run Code Online (Sandbox Code Playgroud)

小智 10

要完全删除包及其所有配置文件:

sudo apt purge postfix
Run Code Online (Sandbox Code Playgroud)

您可以通过检查服务是否正在运行来检查它是否已卸载:

systemctl status postfix
Run Code Online (Sandbox Code Playgroud)

那么它应该说:

Unit postfix.service could not be found.
Run Code Online (Sandbox Code Playgroud)

然后您可以重新安装它。

  • @matigo 评论应该作为答案发布 - Marcii03 做了正确的事情 (2认同)