重新安装 spamassassin(损坏的 perl)

重新安装 spamassassin(损坏的 perl)

我的 Ubuntu 20.10 上的 spamassassin 坏了,我无法重新安装它。

我已经做好了

dpkg --purge spamassassin sa-compile spamc
deluser --remove-all-files debian-spamd
apt update
apt upgrade
apt install spamassassin

我收到错误:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  sa-compile spamc
Suggested packages:
  razor libdbi-perl pyzor libencode-detect-perl libgeoip2-perl libnet-patricia-perl
  libbsd-resource-perl
The following NEW packages will be installed
  sa-compile spamassassin spamc
0 to upgrade, 3 to newly install, 0 to remove and 0 not to upgrade.
Need to get 0 B/1,235 kB of archives.
After this operation, 4,902 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Selecting previously unselected package spamassassin.
(Reading database ... 271754 files and directories currently installed.)
Preparing to unpack .../spamassassin_3.4.5~pre1-3_all.deb ...
Unpacking spamassassin (3.4.5~pre1-3) ...
Selecting previously unselected package sa-compile.
Preparing to unpack .../sa-compile_3.4.5~pre1-3_all.deb ...
Unpacking sa-compile (3.4.5~pre1-3) ...
Selecting previously unselected package spamc.
Preparing to unpack .../spamc_3.4.5~pre1-3_amd64.deb ...
Unpacking spamc (3.4.5~pre1-3) ...
Setting up spamc (3.4.5~pre1-3) ...
Setting up spamassassin (3.4.5~pre1-3) ...
Adding system user `debian-spamd' (UID 131) ...
Adding new group `debian-spamd' (GID 136) ...
Adding new user `debian-spamd' (UID 131) with group `debian-spamd' ...
Not creating home directory `/var/lib/spamassassin'.
Insecure dependency in sprintf while running with -T switch at /usr/lib/x86_64-linux-gnu/perl/5.30/Con
fig.pm line 62.
Compilation failed in require at /usr/lib/x86_64-linux-gnu/perl/5.30/lib.pm line 6.
BEGIN failed--compilation aborted at /usr/lib/x86_64-linux-gnu/perl/5.30/lib.pm line 6.
Compilation failed in require at /usr/bin/sa-update line 36.
BEGIN failed--compilation aborted at /usr/bin/sa-update line 36.
dpkg: error processing package spamassassin (--configure):
 installed spamassassin package post-installation script subprocess returned error exit status 255
dpkg: dependency problems prevent configuration of sa-compile:
 sa-compile depends on spamassassin; however:
  Package spamassassin is not configured yet.

dpkg: error processing package sa-compile (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates it's a follow-up error from a previous fa
ilure.
      Processing triggers for man-db (2.9.3-2) ...
Processing triggers for systemd (246.6-1ubuntu1.4) ...
Errors were encountered while processing:
 spamassassin
 sa-compile
E: Sub-process /usr/bin/dpkg returned an error code (1)

现在如何安装 Ubuntu 软件包 spamassassin?

我也检查了这一点(在另一台机器上):安装 20.04 LTS,升级到 20.10,安装 spamassassin,它可以工作,所以问题出在适当的清理上。

工作安装有 Perl v5.30.3,而非工作安装有 v5.30.0(尽管根据它是最新的apt update)。

非工作 Ubuntu 上的 Perl 版本不一致:

sudo cpan
/usr/bin/cpan: Perl lib version (5.30.3) doesn't match executable     '/usr/bin/perl' version (5.30.0) at /usr/lib/x86_64-linux-gnu/perl/5.30/Config.pm line 62.

Compilation failed in require at /usr/share/perl/5.30/CPAN.pm line 44.

如何更新安装 Perl

答案1

/usr/lib/x86_64-linux-gnu/perl/5.30/Config.pm第 62 行,我将 5.30.3 替换为 5.30.0。

span运行,但经过几个小时的测试后我不得不将其终止,而且它还没有更新/usr/bin/perl

apt install spamassassin成功。

perl最后,我用从其他工作安装复制的 5.30.3替换了5.30.0 并恢复/usr/lib/x86_64-linux-gnu/perl/5.30/Config.pm

两个二进制文件的大小完全相同,都是 3478464 字节。

实际上perl5.30.3已经存在/usr/bin,所以重命名perl就足够了。

安装 spamassassin 后,spamd在第 62 行产生错误/usr/lib/x86_64-linux-gnu/perl-base/Config.pm

sudo apt reinstall perl-base已更新(版本号)/usr/lib/x86_64-linux-gnu/perl-base/Config.pm

答案2

对我来说,有效的方法是确保用户debian-垃圾邮件/etc/passwd而其对应组已从、/etc/shadow和中淘汰/etc/groups

相关内容