降级 Ubuntu 上的邮件服务器(如 Postfix、Dovecot、Exim 等)通常涉及将相关软件包降级到旧版本。下面我按常见场景 + 安全做法给你一套通用流程,并以 Postfix 为例说明。
dpkg -l | grep -E "postfix|dovecot|exim"
常见组合:
postfix --version
dovecot --version
apt-cache policy postfix
示例输出:
postfix:
Installed: 3.8.1
Candidate: 3.8.1
Version table:
3.6.4 500
500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages
如果仓库里没有你想要的旧版本,就需要:
.deb 手动安装systemctl stop postfix
systemctl stop dovecot
cp -r /etc/postfix /etc/postfix.bak
cp -r /etc/dovecot /etc/dovecot.bak
apt install postfix=3.6.4-1ubuntu1
(版本号根据 apt-cache policy 结果填写)
如果依赖冲突:
apt install --allow-downgrades postfix=3.6.4-1ubuntu1
例如:
wget http://archive.ubuntu.com/ubuntu/pool/main/p/postfix/postfix_3.6.4-1ubuntu1_amd64.deb
dpkg -i postfix_3.6.4-1ubuntu1_amd64.deb
如有依赖问题:
apt -f install
apt-mark hold postfix
apt-mark hold dovecot-core
解除:
apt-mark unhold postfix
systemctl start postfix
systemctl start dovecot
postfix status
你可以告诉我:
我可以直接给你精确命令。