我一直在尝试启动一个 dovecot/postfix 服务器来为我的初创企业提供电子邮件服务,但我也成为了写得不好、过时的指南的受害者。
起初我安装了 Postfix 和 Dovecot,并选择了一个空配置,以为我会自己配置它们。在某个时候,我忘记了我实际上在做什么以及我配置了什么,所以我决定删除apt-purge
我安装的所有软件包并重新开始。
尝试使用安装 dovecot 后sudo apt-get install dovecot-imapd
,我遇到了以下错误:
The following NEW packages will be installed:
dovecot-imapd
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/425 kB of archives.
After this operation, 565 kB of additional disk space will be used.
Selecting previously unselected package dovecot-imapd.
(Reading database ... 23009 files and directories currently installed.)
Unpacking dovecot-imapd (from .../dovecot-imapd_1%3a2.1.7-7_amd64.deb) ...
Setting up dovecot-imapd (1:2.1.7-7) ...
Creating config file /etc/dovecot/conf.d/20-imap.conf with new version
cp: cannot create regular file `/etc/dovecot/conf.d/20-imap.conf': No such file or directory
dpkg: error processing dovecot-imapd (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
dovecot-imapd
E: Sub-process /usr/bin/dpkg returned an error code (1)
当我 时dir
/etc/
,我看不到 dovecot 文件夹,如果我使用手动创建它mkdir
并将其 chmod 设置为 777,我仍然会收到 20-imap.conf 不存在且无法创建常规文件的错误。
我在这里没有什么主意,非常感谢你们能给我的任何帮助!
谢谢!
答案1
清除dovecot-common
,然后重试?运行dpkg --get-selections | grep dovecot
,确保每个 dovecot 包都已清除。 dpkg -P packagename
,如果您已删除它,但未清除文件。
一旦您确定所有 dovecot 包都已消失,请确保删除/etc/dovecot
您尝试手动创建的目录。
、/etc/dovecot
和/etc/dovecot/conf.d
属于该dovecot-common
软件包。仅删除 dovecot-imapd 软件包不会删除这些目录。我猜您手动删除了它们,或者发生了其他奇怪的事情。
答案2
apt-get purge....
based on dpkg --get-selections | grep dovecot (which was a life saver) the output should be:
dovecot-core install(those 2 remain no matter what one is using aptitude or apt)
then run:
type dovecot
dovecot is /usr/sbin/dovecot
rm /usr/sbin/dovecot
rm -r /etc/dovecot
dpkg -P 'dovecot-core'(ignore warnings)and dont forget the ''.
After this do a clean install.