当我尝试删除时postfix
出现此错误:
Removing postfix (3.1.0-3) ...
Failed to stop postfix.service: Unit postfix.service not loaded.
invoke-rc.d: initscript postfix, action "stop" failed.
dpkg: error processing package postfix (--remove):
subprocess installed pre-removal script returned error exit status 5
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Errors were encountered while processing:
postfix
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
原因是因为/etc/init.d/postfix
不存在。
我创建了一个空白/etc/init.d/postfix
文件并使用使其可执行sudo chmod +x /etc/init.d/postfix
,然后问题就解决了。
答案2
这对我有用:
创建 postfix 文件后,运行以下命令:
sudo apt-get purge postfix
然后重新安装 postfix:
sudo apt-get --reinstall install postfix