Error in postfix
I am attempting to run sudo apt-get install -f
however it seems that the postfix
package is broken:
$ sudo apt-get install -f
[sudo] password for learner:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up postfix (2.11.0-1ubuntu1) ...
update-rc.d: /etc/init.d/postfix: file does not exist
dpkg: error processing package postfix (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
Errors were encountered while processing:
postfix
E: Sub-process /usr/bin/dpkg returned an error code (1)
However I do not receive an output from:
sudo dkpg --configure -a
I am also getting this error:
$ sudo service postfix status
[sudo] password for learner:
postfix: unrecognized service
Results for sudo apt-get purge(or autoremove) postfix:
learner@juggernaut:~$ sudo apt-get purge postfix
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
lsb-invalid-mta
The following packages will be REMOVED:
postfix*
The following NEW packages will be installed:
lsb-invalid-mta
0 upgraded, 1 newly installed, 1 to remove and 15 not upgraded.
1 not fully installed or removed.
Need to get 0 B/5,106 B of archives.
After this operation, 3,541 kB disk space will be freed.
Do you want to continue? [Y/n] y
dpkg: postfix: dependency problems, but removing anyway as you requested:
lsb-core depends on lsb-invalid-mta (>= 4.1+Debian11ubuntu6) | mail-transport-agent; however:
Package lsb-invalid-mta is not installed.
Package mail-transport-agent is not installed.
Package postfix which provides mail-transport-agent is to be removed.
(Reading database ... 228875 files and directories currently installed.)
Removing postfix (2.11.0-1ubuntu1) ...
invoke-rc.d: unknown initscript, /etc/init.d/postfix not found.
dpkg: error processing package postfix (--purge):
subprocess installed pre-removal script returned error exit status 100
Errors were encountered while processing:
postfix
E: Sub-process /usr/bin/dpkg returned an error code (1)
learner@juggernaut:~$
Solution 1:
@A.B 's comment fixed my issue, bumping to an answer:
sudo touch /etc/init.d/postfix; sudo apt-get purge postfix