我安装了以下系统的VPS:
CPU model : Common KVM processor
Number of cores : 1
CPU frequency : 2499.998 MHz
Total size of Disk : 30.0 GB (6.0 GB Used)
Total amount of Mem : 1995 MB (1043 MB Used)
Total amount of Swap : 0 MB (0 MB Used)
OS : Debian GNU/Linux 10
Arch : x86_64 (64 Bit)
Kernel : 4.19.0-8-amd64
仅安装Mailcow(码头化)。然后,我想安装一些软件包,例如sudo,由于某种原因,会弹出以下错误:
root@mx:~# aptitude upgrade
The following packages will be upgraded:
docker-ce docker-ce-cli
The following partially installed packages will be configured:
debconf
The following packages are RECOMMENDED but will NOT be installed:
aufs-tools cgroupfs-mount libltdl7 pigz
2 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/65.4 MB of archives. After unpacking 19.5 kB will be used.
Do you want to continue? [Y/n/?]
debconf: Perl may be unconfigured (strict.pm did not return a true value at (eval 1) line 2.
BEGIN failed--compilation aborted at (eval 1) line 2.
) -- aborting
Setting up debconf (1.5.71) ...
strict.pm did not return a true value at /usr/share/debconf/frontend line 5.
BEGIN failed--compilation aborted at /usr/share/debconf/frontend line 5.
dpkg: error processing package debconf (--configure):
installed debconf package post-installation script subprocess returned error exit status 255
Errors were encountered while processing:
debconf
E: Sub-process /usr/bin/dpkg returned an error code (1)
特别是这个错误引起了我的注意:
debconf: Perl may be unconfigured (strict.pm did not return a true value at (eval 1) line 2.
BEGIN failed--compilation aborted at (eval 1) line 2.
) -- aborting
我一直试图解决此问题,但没有成功。
尝试#1:perl -e'use strict'返回此:
strict.pm did not return a true value at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
尝试#2:cd / var / cache / apt / archives,然后dpkg -i perl_5.28.1-6_amd64.deb和dpkg -i perl-base_5.28.1-6_amd64.deb结果如下:
root@mx:~# cd /var/cache/apt/archives
root@mx:/var/cache/apt/archives# dpkg -i perl-base_5.28.1-6_amd64.deb
(Reading database ... 40477 files and directories currently installed.)
Preparing to unpack perl-base_5.28.1-6_amd64.deb ...
Unpacking perl-base (5.28.1-6) over (5.28.1-6) ...
Setting up perl-base (5.28.1-6) ...
root@mx:/var/cache/apt/archives# dpkg -i perl_5.28.1-6_amd64.deb
Selecting previously unselected package perl.
(Reading database ... 40477 files and directories currently installed.)
Preparing to unpack perl_5.28.1-6_amd64.deb ...
Unpacking perl (5.28.1-6) over (5.28.1-6) ...
Setting up perl (5.28.1-6) ...
root@mx:/var/cache/apt/archives#
尝试#3:
apt reinstall perl results in this:
root@mx:/var/cache/apt/archives# apt reinstall perl
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 2 not upgraded.
1 not fully installed or removed.
Need to get 0 B/204 kB of archives.
After this operation, 0 B of additional disk space will be used.
debconf: Perl may be unconfigured (strict.pm did not return a true value at (eval 1) line 2.
BEGIN failed--compilation aborted at (eval 1) line 2.
) -- aborting
Setting up debconf (1.5.71) ...
strict.pm did not return a true value at /usr/share/debconf/frontend line 5.
BEGIN failed--compilation aborted at /usr/share/debconf/frontend line 5.
dpkg: error processing package debconf (--configure):
installed debconf package post-installation script subprocess returned error exit status 255
Errors were encountered while processing:
debconf
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@mx:/var/cache/apt/archives#
尝试#4:由于未安装perl5,我尝试清除perl并使用apt remove --purge perl && sudo apt install perl重新安装它结果是:
root@mx:/var/cache/apt/archives# apt remove --purge perl && sudo apt install perl
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
git-man libapt-pkg-perl libcurl3-gnutls libgdbm-compat4 libgdbm6 libperl5.28 patch perl-modules-5.28
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
apt-file* git* libcgi-fast-perl* libcgi-pm-perl* libclass-accessor-perl* libencode-locale-perl* liberror-perl* libexporter-tiny-perl* libfcgi-perl* libhtml-parser-perl* libhtml-tagset-perl*
libhttp-date-perl* libhttp-message-perl* libio-html-perl* libio-string-perl* liblist-moreutils-perl* liblwp-mediatypes-perl* libparse-debianchangelog-perl* libregexp-assemble-perl* libsub-name-perl*
libtimedate-perl* liburi-perl* perl*
0 upgraded, 0 newly installed, 23 to remove and 2 not upgraded.
1 not fully installed or removed.
After this operation, 39.4 MB disk space will be freed.
Do you want to continue? [Y/n]
debconf: Perl may be unconfigured (strict.pm did not return a true value at (eval 1) line 2.
BEGIN failed--compilation aborted at (eval 1) line 2.
) -- aborting
Setting up debconf (1.5.71) ...
strict.pm did not return a true value at /usr/share/debconf/frontend line 5.
BEGIN failed--compilation aborted at /usr/share/debconf/frontend line 5.
dpkg: error processing package debconf (--configure):
installed debconf package post-installation script subprocess returned error exit status 255
Errors were encountered while processing:
debconf
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@mx:/var/cache/apt/archives#
尝试#5:perl -V返回此:
root@mx:/usr/share/perl/5.28.1# perl -V
strict.pm did not return a true value at /usr/lib/x86_64-linux-gnu/perl/5.28/Config.pm line 9.
BEGIN failed--compilation aborted at /usr/lib/x86_64-linux-gnu/perl/5.28/Config.pm line 9.
Compilation failed in require.
BEGIN failed--compilation aborted.
关于strict.pm,它似乎位于/usr/share/perl/5.28.1/strict.pm中,并且包含一长串带有以下内容的长行:
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^ (and so on ..)
“通过简单地将其替换为]来解决”
1; __END__
但是现在出现以下错误:
debconf: Perl may be unconfigured (IO/File.pm did not return a true value at /usr/share/perl/5.28/FileHandle.pm line 9.
而且该文件IO / File.pm似乎不存在-手动添加它无济于事。
尝试#6:在@ikegami(注释)的帮助下,strict.pm已得到修复,但以下文件似乎仍然损坏(特别是IO / File.pm):
Setting up debconf (1.5.71) ... IO/File.pm did not return a true value at /usr/share/perl/5.28/FileHandle.pm line 9. Compilation failed in require at /usr/share/perl5/Debconf/Template.pm line 8. BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Template.pm line 8. Compilation failed in require at /usr/share/perl5/Debconf/Question.pm line 8. BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Question.pm line 8. Compilation failed in require at /usr/share/perl5/Debconf/Config.pm line 7. BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Config.pm line 7. Compilation failed in require at /usr/share/perl5/Debconf/Log.pm line 10. Compilation failed in require at /usr/share/perl5/Debconf/Db.pm line 7. BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Db.pm line 7. Compilation failed in require at /usr/share/debconf/frontend line 7. BEGIN failed--compilation aborted at /usr/share/debconf/frontend line 7. dpkg: error processing package debconf (--configure): installed debconf package post-installation script subprocess returned error exit status 255 Errors were encountered while processing: debconf E: Sub-process /usr/bin/dpkg returned an error code (1)
信息1:root @ mx:/usr/share/perl/5.28#查找/ usr / share / perl -name'* .pm'-exec perl
-0777ne'print "$ARGV\n" if /\0/' {} + /usr/share/perl/5.28.1/Net/FTP/A.pm /usr/share/perl/5.28.1/Net/FTP/I.pm /usr/share/perl/5.28.1/Net/FTP/L.pm /usr/share/perl/5.28.1/Net/FTP/E.pm /usr/share/perl/5.28.1/Net/FTP/dataconn.pm /usr/share/perl/5.28.1/Net/FTP.pm /usr/share/perl/5.28.1/Net/SMTP.pm /usr/share/perl/5.28.1/Net/hostent.pm /usr/share/perl/5.28.1/Net/Time.pm /usr/share/perl/5.28.1/utf8.pm /usr/share/perl/5.28.1/Pod/Html.pm /usr/share/perl/5.28.1/Pod/Functions.pm /usr/share/perl/5.28.1/Pod/Find.pm /usr/share/perl/5.28.1/sigtrap.pm /usr/share/perl/5.28.1/perlfaq.pm /usr/share/perl/5.28.1/subs.pm /usr/share/perl/5.28.1/IO/Socket/IP.pm /usr/share/perl/5.28.1/IO/Compress/Zlib/Constants.pm /usr/share/perl/5.28.1/IO/Compress/Zlib/Extra.pm /usr/share/perl/5.28.1/IO/Compress/Gzip/Constants.pm /usr/share/perl/5.28.1/IO/Compress/Gzip.pm /usr/share/perl/5.28.1/IO/Compress/RawDeflate.pm /usr/share/perl/5.28.1/IO/Uncompress/RawInflate.pm /usr/share/perl/5.28.1/IO/Uncompress/Adapter/Identity.pm /usr/share/perl/5.28.1/IO/Uncompress/Adapter/Bunzip2.pm /usr/share/perl/5.28.1/IO/Uncompress/Base.pm /usr/share/perl/5.28.1/IO/Uncompress/Unzip.pm /usr/share/perl/5.28.1/IO/Uncompress/Bunzip2.pm /usr/share/perl/5.28.1/vmsish.pm /usr/share/perl/5.28.1/Locale/Codes/LangFam_Codes.pm /usr/share/perl/5.28.1/Locale/Codes/LangVar.pm /usr/share/perl/5.28.1/Locale/Codes/LangExt_Retired.pm /usr/share/perl/5.28.1/Locale/Codes/LangFam_Retired.pm /usr/share/perl/5.28.1/Locale/Codes/LangFam.pm /usr/share/perl/5.28.1/Test2/API/Stack.pm /usr/share/perl/5.28.1/Test2/Event.pm /usr/share/perl/5.28.1/Test2/API.pm /usr/share/perl/5.28.1/Test2/Event/Waiting.pm /usr/share/perl/5.28.1/Test2/EventFacet/Info.pm /usr/share/perl/5.28.1/Test2/EventFacet/Amnesty.pm /usr/share/perl/5.28.1/Test2/EventFacet/About.pm /usr/share/perl/5.28.1/Test2/EventFacet/Assert.pm /usr/share/perl/5.28.1/Test2/EventFacet/Hub.pm /usr/share/perl/5.28.1/Test2/EventFacet/Control.pm /usr/share/perl/5.28.1/Test2/EventFacet/Error.pm /usr/share/perl/5.28.1/overload/numbers.pm /usr/share/perl/5.28.1/sort.pm /usr/share/perl/5.28.1/parent.pm
信息2:root @ mx:查找/ -name“ File.pm”
/usr/share/perl/5.28.1/Archive/Tar/File.pm
/usr/share/perl/5.28.1/TAP/Parser/SourceHandler/File.pm
/usr/share/perl/5.28.1/TAP/Formatter/File.pm
/usr/share/perl/5.28.1/Tie/File.pm
/usr/share/perl5/Debconf/DbDriver/File.pm
/usr/lib/x86_64-linux-gnu/perl/5.28.1/IO/File.pm
/usr/lib/x86_64-linux-gnu/perl-base/IO/File.pm
我安装了以下系统的VPS:CPU型号:通用KVM处理器内核数:1 CPU频率:2499.998 MHz磁盘总大小:30.0 GB(已使用6.0 GB)...
apt
重新安装Perl: