This issue is a bit nasty though, as if a user encounters it,
recovering with apt is impossible as dpkg depends on perl and will not
run if libcrypt1 got broken:

$ apt -y install libcrypt1
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libc-bin : Depends: libc6 (< 2.25) but 2.32-2 is to be installed
            Recommends: manpages but it is not going to be installed
 libcrypt1 : Conflicts: libpam0g (< 1.4.0-10) but 1.1.8-3.6 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages
(or specify a solution).

$ apt -y --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libc-bin
Recommended packages:
  manpages
The following packages will be upgraded:
  libc-bin
1 upgraded, 0 newly installed, 0 to remove and 95 not upgraded.
1 not fully installed or removed.
Need to get 829 kB of archives.
After this operation, 341 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian sid/main amd64 libc-bin amd64 2.32-2 [829 kB]
Fetched 829 kB in 0s (5968 kB/s)
/usr/bin/perl: error while loading shared libraries: libcrypt.so.1:
cannot open shared object file: No such file or directory
Setting up libc6:amd64 (2.32-2) ...
/usr/bin/perl: error while loading shared libraries: libcrypt.so.1:
cannot open shared object file: No such file or directory
dpkg: error processing package libc6:amd64 (--configure):
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
 libc6:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)


Here are manual steps on how to recover:

$ cd /tmp
$ apt -y download libcrypt1
$ dpkg-deb -x libcrypt1_1%3a4.4.25-2_amd64.deb  .
$ cp -av lib/x86_64-linux-gnu/* /lib/x86_64-linux-gnu/
$ apt -y --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libc-bin
Recommended packages:
  manpages
The following packages will be upgraded:
  libc-bin
1 upgraded, 0 newly installed, 0 to remove and 95 not upgraded.
1 not fully installed or removed.
Need to get 829 kB of archives.
After this operation, 341 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian sid/main amd64 libc-bin amd64 2.32-2 [829 kB]
Fetched 829 kB in 0s (5292 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Setting up libc6:amd64 (2.32-2) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog
based frontend cannot be used. at
/usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
Checking for services that may need to be restarted...
Checking init scripts...
Nothing to restart.
(Reading database ... 9176 files and directories currently installed.)
Preparing to unpack .../libc-bin_2.32-2_amd64.deb ...
Unpacking libc-bin (2.32-2) over (2.24-11+deb9u4) ...
Setting up libc-bin (2.32-2) ...
Updating /etc/nsswitch.conf to current default.
W: APT had planned for dpkg to do more than it reported back (5 vs 9).
   Affected packages: libc6:amd64


Also note that there is no workaround to *not* hit this bug, as any
attempt to install libcrypt1 will also pull in libc and thus break
Perl and dpkg before libcrypt1 is unpacked.

$ apt-get install -y libcrypt1
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  gcc-11-base libc-bin libc6 libgcc-s1 libidn2-0 libpam0g libunistring2
Suggested packages:
  glibc-doc libc-l10n locales libnss-nis libnss-nisplus libpam-doc
Recommended packages:
  manpages
The following NEW packages will be installed:
  gcc-11-base libcrypt1 libgcc-s1 libidn2-0 libunistring2
The following packages will be upgraded:
  libc-bin libc6 libpam0g
3 upgraded, 5 newly installed, 0 to remove and 94 not upgraded.
Need to get 4590 kB of archives.
After this operation, 5108 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian sid/main amd64 gcc-11-base amd64
11.2.0-4 [205 kB]
Get:2 http://deb.debian.org/debian sid/main amd64 libgcc-s1 amd64
11.2.0-4 [41.7 kB]
Get:3 http://deb.debian.org/debian sid/main amd64 libc6 amd64 2.32-2 [2817 kB]
Get:4 http://deb.debian.org/debian sid/main amd64 libc-bin amd64 2.32-2 [829 kB]
Get:5 http://deb.debian.org/debian sid/main amd64 libpam0g amd64
1.4.0-10 [130 kB]
Get:6 http://deb.debian.org/debian sid/main amd64 libcrypt1 amd64
1:4.4.25-2 [89.2 kB]
Get:7 http://deb.debian.org/debian sid/main amd64 libunistring2 amd64
0.9.10-6 [384 kB]
Get:8 http://deb.debian.org/debian sid/main amd64 libidn2-0 amd64
2.3.2-2 [95.3 kB]
Fetched 4590 kB in 1s (3459 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package gcc-11-base:amd64.
(Reading database ... 9179 files and directories currently installed.)
Preparing to unpack .../gcc-11-base_11.2.0-4_amd64.deb ...
Unpacking gcc-11-base:amd64 (11.2.0-4) ...
Setting up gcc-11-base:amd64 (11.2.0-4) ...
Selecting previously unselected package libgcc-s1:amd64.
(Reading database ... 9184 files and directories currently installed.)
Preparing to unpack .../libgcc-s1_11.2.0-4_amd64.deb ...
Unpacking libgcc-s1:amd64 (11.2.0-4) ...
Replacing files in old package libgcc1:amd64 (1:6.3.0-18+deb9u1) ...
Setting up libgcc-s1:amd64 (11.2.0-4) ...
(Reading database ... 9186 files and directories currently installed.)
Preparing to unpack .../libc6_2.32-2_amd64.deb ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog
based frontend cannot be used. at
/usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
Checking for services that may need to be restarted...
Checking init scripts...
Unpacking libc6:amd64 (2.32-2) over (2.24-11+deb9u4) ...
Setting up libc6:amd64 (2.32-2) ...
Installing new version of config file
/etc/ld.so.conf.d/x86_64-linux-gnu.conf ...
/usr/bin/perl: error while loading shared libraries: libcrypt.so.1:
cannot open shared object file: No such file or directory
dpkg: error processing package libc6:amd64 (--configure):
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
 libc6:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

Reply via email to