When I try to remove postfix
I get this error:
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)
This Worked for me:
After creating a postfix file, run this command:
And then reinstall postfix:
The reason was because
/etc/init.d/postfix
did not exist.I created a blank
/etc/init.d/postfix
file and made it executable usingsudo chmod +x /etc/init.d/postfix
, then problem solved.