libcrypt.so.1: cannot open shared object file when upgrading from Debian Buster to Bullseye

Having fun while upgrading Debian 10 to 11.

The Problem

The following error is thrown during a Debian upgrade from Buster to Bullseye:

/usr/bin/python3: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory

The file /lib/x86_64-linux-gnu/libcrypt.so.1 used to be in package libc6 on Stretch and Buster until it was split off into a separate libcrypt in Bullseye (and in Sid).

When upgrading libc6 the system ends in a situation where libcrypt.so.1 is removed before a replacement from a new package is installed.

The Workaround

This is the repo file /etc/apt/sources.list:

deb [arch=amd64] http://ftp.uk.debian.org/debian/ bullseye main contrib non-free
deb-src http://ftp.uk.debian.org/debian/ bullseye main contrib non-free

deb [arch=amd64] http://security.debian.org/debian-security bullseye-security main contrib non-free
deb-src http://security.debian.org/debian-security bullseye-security main contrib non-free

deb [arch=amd64] http://ftp.uk.debian.org/debian/ bullseye-updates main contrib non-free
deb-src http://ftp.uk.debian.org/debian/ bullseye-updates main contrib non-free

deb [arch=amd64] http://deb.debian.org/debian bullseye-backports main contrib non-free
deb-src http://deb.debian.org/debian bullseye-backports main contrib non-free

And these are the steps that I used to resolve the problem:

$ cd /tmp
$ apt download libcrypt1
$ dpkg-deb -x libcrypt1_1%3a4.4.33-2_amd64.deb  .
$ sudo cp -av lib/x86_64-linux-gnu/* /lib/x86_64-linux-gnu/
$ sudo apt --fix-broken install

References

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=993755

17 thoughts on “libcrypt.so.1: cannot open shared object file when upgrading from Debian Buster to Bullseye

Leave a Reply

Your email address will not be published. Required fields are marked *