strict.pm не вернул истинное значение в строке (eval 1) 2 - PullRequest
0 голосов
/ 15 марта 2020

У меня 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 (dockerized). Затем я захотел установить некоторые пакеты, такие как 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 'Использовать строгий' возвращает это:

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 / F ile.pm, кажется, не существует - добавление его вручную не помогло.

Попробуйте # 6: С помощью @ikegami (комментарии), strict.pm был исправлен, но следующие файлы кажутся сломанными still (в частности, 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)

Info # 1: root@mx: / usr / share / perl / 5.28 # find / usr / share / perl -name '*. pm '-exe c 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

1 Ответ

0 голосов
/ 16 марта 2020

Выполнение следующих команд должно исправить достаточно поврежденных файлов, чтобы можно было переустановить Perl с помощью apt:

>/usr/share/perl/5.28.1/utf8.pm                             curl https://raw.githubusercontent.com/Perl/perl5/v5.28.1/lib/utf8.pm
>/usr/share/perl/5.28.1/subs.pm                             curl https://raw.githubusercontent.com/Perl/perl5/v5.28.1/lib/subs.pm
>/usr/share/perl/5.28.1/IO/Socket/IP.pm                     curl https://raw.githubusercontent.com/Perl/perl5/v5.28.1/cpan/IO-Socket-IP/lib/IO/Socket/IP.pm
>/usr/share/perl/5.28.1/IO/Compress/Zlib/Constants.pm       curl https://raw.githubusercontent.com/Perl/perl5/v5.28.1/cpan/IO-Compress/lib/IO/Compress/Zlib/Constants.pm
>/usr/share/perl/5.28.1/IO/Compress/Zlib/Extra.pm           curl https://raw.githubusercontent.com/Perl/perl5/v5.28.1/cpan/IO-Compress/lib/IO/Compress/Zlib/Extra.pm
>/usr/share/perl/5.28.1/IO/Compress/Gzip/Constants.pm       curl https://raw.githubusercontent.com/Perl/perl5/v5.28.1/cpan/IO-Compress/lib/IO/Compress/Gzip/Constants.pm
>/usr/share/perl/5.28.1/IO/Compress/Gzip.pm                 curl https://raw.githubusercontent.com/Perl/perl5/v5.28.1/cpan/IO-Compress/lib/IO/Compress/Gzip.pm
>/usr/share/perl/5.28.1/IO/Compress/RawDeflate.pm           curl https://raw.githubusercontent.com/Perl/perl5/v5.28.1/cpan/IO-Compress/lib/IO/Compress/RawDeflate.pm
>/usr/share/perl/5.28.1/IO/Uncompress/RawInflate.pm         curl https://raw.githubusercontent.com/Perl/perl5/v5.28.1/cpan/IO-Compress/lib/IO/Uncompress/RawInflate.pm
>/usr/share/perl/5.28.1/IO/Uncompress/Adapter/Identity.pm   curl https://raw.githubusercontent.com/Perl/perl5/v5.28.1/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Identity.pm
>/usr/share/perl/5.28.1/IO/Uncompress/Adapter/Bunzip2.pm    curl https://raw.githubusercontent.com/Perl/perl5/v5.28.1/cpan/IO-Compress/lib/IO/Uncompress/Adapter/Bunzip2.pm
>/usr/share/perl/5.28.1/IO/Uncompress/Base.pm               curl https://raw.githubusercontent.com/Perl/perl5/v5.28.1/cpan/IO-Compress/lib/IO/Uncompress/Base.pm
>/usr/share/perl/5.28.1/IO/Uncompress/Unzip.pm              curl https://raw.githubusercontent.com/Perl/perl5/v5.28.1/cpan/IO-Compress/lib/IO/Uncompress/Unzip.pm
>/usr/share/perl/5.28.1/IO/Uncompress/Bunzip2.pm            curl https://raw.githubusercontent.com/Perl/perl5/v5.28.1/cpan/IO-Compress/lib/IO/Uncompress/Bunzip2.pm
>/usr/share/perl/5.28.1/overload/numbers.pm                 curl https://raw.githubusercontent.com/Perl/perl5/v5.28.1/lib/overload/numbers.pm
>/usr/share/perl/5.28.1/sort.pm                             curl https://raw.githubusercontent.com/Perl/perl5/v5.28.1/lib/sort.pm
>/usr/share/perl/5.28.1/parent.pm                           curl https://raw.githubusercontent.com/Perl/perl5/v5.28.1/cpan/parent/lib/parent.pm
...