dpkg: 处理邮件堆栈交付包时出错

dpkg: 处理邮件堆栈交付包时出错

在安装这个时mail-stack-delivery我想清除配置文件并重新开始,但似乎把它弄乱了:

thufir@mordor:~$ 
thufir@mordor:~$ sudo dpkg --configure -a
Setting up mail-stack-delivery (1:2.2.18-2ubuntu2) ...
grep: /etc/dovecot/conf.d/10-ssl.conf: No such file or directory
grep: /etc/dovecot/conf.d/10-ssl.conf: No such file or directory
ln: failed to create symbolic link ‘/etc/dovecot/private/dovecot.pem’: No such file or directory
dpkg: error processing package mail-stack-delivery (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 mail-stack-delivery
thufir@mordor:~$ 
thufir@mordor:~$ sudo rm /etc/apt/sources.list
thufir@mordor:~$ 
thufir@mordor:~$ ls /etc/dovecot/
conf.d
thufir@mordor:~$ 
thufir@mordor:~$ ls /etc/postfix/
thufir@mordor:~$ 

使用后sudo apt-get remove --purge mail-stack-delivery

The following packages will be REMOVED:
  mail-stack-delivery*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] 
(Reading database ... 201365 files and directories currently installed.)
Removing mail-stack-delivery (1:2.2.18-2ubuntu2) ...
Purging configuration files for mail-stack-delivery (1:2.2.18-2ubuntu2) ...
W: Can not find PkgVer for 'mail-stack-delivery'

陷入循环,我似乎无法正确移除或安装它。

答案1

我不知道以下答案是,我在 freenode IRC 上的 linux 聊天室的帮助下偶然找到了这个“解决方案”(感谢 Jim 和 peetaur2):

thufir@mordor:~$ 
thufir@mordor:~$ sudo mkdir /etc/postfix /etc/dovecot/ /etc/dovecot/private/ /etc/dovecot/conf.d/
thufir@mordor:~$ 
thufir@mordor:~$ sudo apt-get install mail-stack-delivery
Reading package lists... Done
Building dependency tree       
Reading state information... Done
mail-stack-delivery is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 145 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] 
Setting up mail-stack-delivery (1:2.2.18-2ubuntu2) ...
grep: /etc/dovecot/conf.d/10-ssl.conf: No such file or directory
grep: /etc/dovecot/conf.d/10-ssl.conf: No such file or directory

Postfix not configured. Run
sudo dpkg-reconfigure postfix and choose
the type of mail server. Then run
sudo dpkg-reconfigure mail-stack-delivery to
finish mail-stack-delivery installation.

thufir@mordor:~$ 
thufir@mordor:~$ sudo dpkg-reconfigure mail-stack-delivery
grep: /etc/dovecot/conf.d/10-ssl.conf: No such file or directory
grep: /etc/dovecot/conf.d/10-ssl.conf: No such file or directory

Postfix not configured. Run
sudo dpkg-reconfigure postfix and choose
the type of mail server. Then run
sudo dpkg-reconfigure mail-stack-delivery to
finish mail-stack-delivery installation.

thufir@mordor:~$ sudo dpkg-reconfigure postfix
setting synchronous mail queue updates: true
Creating /etc/postfix/dynamicmaps.cf
Adding tcp map entry to /etc/postfix/dynamicmaps.cf
Adding sqlite map entry to /etc/postfix/dynamicmaps.cf
setting myhostname: mordor.bounceme.net
setting alias maps
setting alias database
setting myorigin
setting destinations: mordor.bounceme.net, localhost.bounceme.net, localhost
setting relayhost: 
setting mynetworks: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
setting mailbox_size_limit: 0
setting recipient_delimiter: +
setting inet_interfaces: loopback-only
setting default_transport: error
setting relay_transport: error
setting inet_protocols: all
WARNING: /etc/aliases exists, but does not have a root alias.

Postfix is now set up with a default configuration.  If you need to make 
changes, edit
/etc/postfix/main.cf (and others) as needed.  To view Postfix configuration
values, see postconf(1).

After modifying main.cf, be sure to run '/etc/init.d/postfix reload'.

Running newaliases
Processing triggers for libc-bin (2.21-0ubuntu4) ...
thufir@mordor:~$ 
thufir@mordor:~$ sudo dpkg-reconfigure mail-stack-delivery
grep: /etc/dovecot/conf.d/10-ssl.conf: No such file or directory
grep: /etc/dovecot/conf.d/10-ssl.conf: No such file or directory
Mail stack delivery changes some postfix settings.
Old values are stored in /var/backups/mail-stack-delivery/main.cf-backup.
Feel free to revert any of them when the process is done.
Configuring postfix for mail-stack-delivery integration: .................... done.
thufir@mordor:~$ 
thufir@mordor:~$ 
thufir@mordor:~$ sudo dpkg --configure -a
thufir@mordor:~$ 

很有可能其他东西打破循环并允许dpk并且apt无错误运行。

我怎样才能彻底清除这个包和所有配置?

我今天学到的一个有用的 CLI 命令: update-manager调出 apt GUI。

相关内容