title: strict.pm did not return a true value at (eval 1) line 2
body: <p>I have a VPS with the following System installed:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>with only Mailcow (dockerized) installed. I then wanted to install some packages like sudo and for some reason the following error pops up:</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>Specifically this error catched my attention:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>I've been trying to fix this issue with no success at all.</p>
  
  <p>Try #1:
  perl -e 'use strict' returns this:</p>
  
  <pre><code>strict.pm did not return a true value at -e line 1.
  BEGIN failed--compilation aborted at -e line 1.
  </code></pre>
  
  <p>Try #2:
  cd /var/cache/apt/archives, then dpkg -i perl_5.28.1-6_amd64.deb and dpkg -i perl-base_5.28.1-6_amd64.deb results in this:</p>
  
  <pre><code>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#
  </code></pre>
  
  <p>Try #3:</p>
  
  <pre><code>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#
  </code></pre>
  
  <p>Try #4:
  Since perl5 isn't installed, I tried purging perl and reinstalling it with apt remove --purge perl &amp;&amp; sudo apt install perl
  Results are:</p>
  
  <pre><code>root@mx:/var/cache/apt/archives# apt remove --purge perl &amp;&amp; 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#
  </code></pre>
  
  <p>Try #5:
  perl -V returns this:</p>
  
  <pre><code>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.
  </code></pre>
  
  <p>About strict.pm, it seems to be localted in /usr/share/perl/5.28.1/strict.pm and contains a massive long line with the following:</p>
  
  <pre><code>^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^ (and so on ..)
  </code></pre>
  
  <p>"fixed" it by simply replacing it with </p>
  
  <pre><code>1;
  __END__
  </code></pre>
  
  <p>but now the following error occours:</p>
  
  <pre><code>debconf: Perl may be unconfigured (IO/File.pm did not return a true value at /usr/share/perl/5.28/FileHandle.pm line 9.
  </code></pre>
  
  <p>and that file, IO/File.pm, seems to not exist - adding it manually didn't help.</p>
  
  <p>Try #6:
  With the help of @ikegami (comments), strict.pm has been fixed, yet the following files seem broken still (specifically IO/File.pm):</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>Info #1:
  root@mx:/usr/share/perl/5.28# find /usr/share/perl -name '*.pm' -exec perl </p>
  
  <pre><code>-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
  </code></pre>
  
  <p>Info #2:
  root@mx: find / -name "File.pm"</p>
  
  <pre><code>/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
  </code></pre>