如何解决后缀安装问题?


1

postfix有一些问题。当我尝试删除它,以便我可以重新安装:

learner@juggernaut:~$ sudo apt-get remove 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 0 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 ... 228881 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 (--remove):
 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)

输出sudo apt-get purge postfix

learner@juggernaut:~$ sudo apt-get purge postfix
[sudo] password for learner: 
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 0 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 ... 228881 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:~$ 

当我尝试重新安装时:

learner@juggernaut:~$ sudo apt-get install postfix
[sudo] password for learner: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
postfix is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
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)
learner@juggernaut:~$

我记得我在安装过程中选择了网站

这是mail.log

Jan 27 20:09:33 juggernaut postfix/postdrop[3385]: warning: mail_queue_enter: create file maildrop/152326.3385: Permission denied
Jan 27 20:09:43 juggernaut postfix/postdrop[3385]: warning: mail_queue_enter: create file maildrop/152587.3385: Permission denied
Jan 27 20:09:53 juggernaut postfix/postdrop[3385]: warning: mail_queue_enter: create file maildrop/152915.3385: Permission denied
Jan 27 20:10:03 juggernaut postfix/postdrop[3385]: warning: mail_queue_enter: create file maildrop/153202.3385: Permission denied
Jan 27 20:10:13 juggernaut postfix/postdrop[3385]: warning: mail_queue_enter: create file maildrop/153447.3385: Permission denied

这些是mail.err中的条目

Jan 27 19:57:10 juggernaut postfix[5929]: error: to submit mail, use the Postfix sendmail command
Jan 27 19:57:10 juggernaut postfix[5929]: fatal: the postfix command is reserved for the superuser
Jan 27 19:57:29 juggernaut postfix/postfix-script[5936]: error: unknown command: ''
Jan 27 19:57:29 juggernaut postfix/postfix-script[5937]: fatal: usage: postfix start (or stop, reload, abort, flush, check, status, set-permissions, upgrade-configuration)
Jan 27 20:08:52 juggernaut postfix[3372]: error: to submit mail, use the Postfix sendmail command
Jan 27 20:08:52 juggernaut postfix[3372]: fatal: the postfix command is reserved for the superuser
Jan 27 20:09:05 juggernaut postfix/postfix-script[3380]: error: unknown command: ''
Jan 27 20:09:05 juggernaut postfix/postfix-script[3381]: fatal: usage: postfix start (or stop, reload, abort, flush, check, status, set-permissions, upgrade-configuration)
Jan 27 20:09:13 juggernaut postfix[3382]: error: to submit mail, use the Postfix sendmail command
Jan 27 20:09:13 juggernaut postfix[3382]: fatal: the postfix command is reserved for the superuser
Jan 27 20:17:26 juggernaut postfix[3701]: error: to submit mail, use the Postfix sendmail command
Jan 27 20:17:26 juggernaut postfix[3701]: fatal: the postfix command is reserved for the superuser
Jan 27 20:18:53 juggernaut postfix[3864]: error: to submit mail, use the Postfix sendmail command
Jan 27 20:18:53 juggernaut postfix[3864]: fatal: the postfix command is reserved for the superuser
Jan 29 14:19:27 juggernaut postfix/postfix-script[22221]: error: unknown command: ''
Jan 29 14:19:27 juggernaut postfix/postfix-script[22222]: fatal: usage: postfix start (or stop, reload, abort, flush, check, status, set-permissions, upgrade-configuration)
Jan 29 14:21:13 juggernaut postfix[22826]: error: to submit mail, use the Postfix sendmail command
Jan 29 14:21:13 juggernaut postfix[22826]: fatal: the postfix command is reserved for the superuser
Jan 30 17:49:32 juggernaut postfix[9225]: error: to submit mail, use the Postfix sendmail command
Jan 30 17:49:32 juggernaut postfix[9225]: fatal: the postfix command is reserved for the superuser
Jan 30 17:49:42 juggernaut postfix/postfix-script[9255]: error: unknown command: ''
Jan 30 17:49:42 juggernaut postfix/postfix-script[9256]: fatal: usage: postfix start (or stop, reload, abort, flush, check, status, set-permissions, upgrade-configuration)

Answers:


0

运行以下命令:

$ sudo touch /etc/init.d/postfix
$ sudo apt-get remove postfix

它正在寻找一个/etc/init.d/postfix因任何原因不存在的文件。给它这个文件可以让卸载完成


2
这创建了一个dumy文件,它删除,问题解决了...
juggernauthk108
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.