Disclaimer:
Some reported that their systems crashed after using this answer.
So anyone who is trying this, please be careful and make sure you create backups before trying it.
To my knowledge, libc6 2.29 is the latest version. And it is available for Ubuntu 19.04 (link).
If you want to install libc6 amd64, open this link to download it, then open the download folder in the terminal and run sudo dpkg -i libc6_2.29-0ubuntu2_amd64.deb
If you want to install libc6 i386, you can download it from this link, then open the download folder in the terminal and run sudo dpkg -i libc6_2.29-0ubuntu2_i386.deb
EDIT 06/01/2020:
As per now, libc6_2.29 does not exist anymore. However libc6_2.30 and lib6_2.31 are available via this link (2.31 is the official version for Ubuntu 20.04).
If you want to download a different version than the official one supported by your Ubuntu release (i.e 2.27 for 18.04, 2.30 for Ubuntu 19.10 ...) check this link.
Download the version that suits you, then open the download folder and run sudo dpkg -i <the_file_name>.
Hello everyone, I am currently running a buster system and accidentally upgraded my libc6 to the latest sid version. I am trying to revert to the old version, but when using:apt-get libc6=...
Bu I get the error message:/usr/bin/python3: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory Does someone have an Idea how I can fix that? Because it seems i need libc6 to install libc6...
SOLVED: For anyone stumbling into this, or a similar error in 6 years:
Here is my solution, which is heavy inspired by this post.
1.Use a boot-USB to get into recovery mode, pick your partition and start a shell on the partition.
2. Download the libc6 version you want for example with wget.
3. Extract the package with dpkg -x <pagk.deb> ./newlib
4. Now quit and change to the shell on your Recovery-USB
5. Replace the new library with the old cp -avf newlib/lib/x86_64-linux-gnu/* /target/lib/x86_64-linux-gnu/
6. You should be able to boot again. apt-get should work now to.
7. Reinstall all broken packeges (including libc6) with apt get.
Disclaimer:
Some reported that their systems crashed after using this answer.
So anyone who is trying this, please be careful and make sure you create backups before trying it.
To my knowledge, libc6 2.29 is the latest version. And it is available for Ubuntu 19.04 (link).
If you want to install libc6 amd64, open this link to download it, then open the download folder in the terminal and run sudo dpkg -i libc6_2.29-0ubuntu2_amd64.deb
If you want to install libc6 i386, you can download it from this link, then open the download folder in the terminal and run sudo dpkg -i libc6_2.29-0ubuntu2_i386.deb
EDIT 06/01/2020:
As per now, libc6_2.29 does not exist anymore. However libc6_2.30 and lib6_2.31 are available via this link (2.31 is the official version for Ubuntu 20.04).
If you want to download a different version than the official one supported by your Ubuntu release (i.e 2.27 for 18.04, 2.30 for Ubuntu 19.10 ...) check this link.
Download the version that suits you, then open the download folder and run sudo dpkg -i <the_file_name>.
Don't do it. Here I'll leave an image of how dependent are your software packages on libc6 compiled for that specific library!!! https://sites.google.com/view/dependency-netwok/.
There you'll see a star shaped network and the node at the center (green colored) represents libc6. I suggest two possible solutions to your problem:
1. Add a compatible repository
Since it is r-base-core what you want, change the repository to a compatible one for your specific distribution.
For example: deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/
In your /etc/apt/sources.list file. By using you will be automatically be redirected to a nearby CRAN mirror. See https://cran.r-project.org/mirrors.html for the current list of CRAN mirrors.
sudo apt-get update
sudo apt-get install r-base
sudo apt-get install r-recommended
2. Upgrade
Another solution would be to upgrade your entire distribution to a more recent and compatible with what you want.
You configured your system to use packages from several distributions at once (a so-called Frankenstein-Debian), so dependency errors are normal. Run cat /etc/apt/sources.list{,.d/*.list} in bash to list all sources.
Your libc6 (version 2.27-6) is stuck somewhere between stretch (version 2.24-11+deb9u4) and buster (version 2.28-10). My guess is you pulled some packages from buster, while it was still the testing distribution. The easiest way to solve this problem is:
Find in your APT sources a reference to testing or buster. If you find something like:
deb http://deb.debian.org/debian testing main non-free contribreplace it with:
deb http://deb.debian.org/debian buster main non-free contribsince buster isn't the testing distribution any more (bullseye is).
Update the list of packages:
apt updateUpgrade your libc6 to the version from buster:
apt install libc6/buster libc6-dev/buster libc-dev-bin/busterConsider upgrading to Debian 10 in the near future to have all packages from the same distribution.
Edit: It seems you have few packages with a version higher than Stretch, so you can just downgrade them:
apt install libc6/stretch libc6-dev/stretch libc-dev-bin/stretch libc-bin/stretch locales/stretch sudo/stretch
and remove buster and company from APT sources.
I just now had this same issue moving from Debian Stretch to Sid in WSL, which is why I landed on this question searching for a fix.
Luckily, I was able to mitigate it fairly easily.
I apologize for responding with a WSL-specific answer to your question, but anything I mention here not specific to WSL should work on a regular Debian distro, too. The packages are the same on either platform.
For an example of a WSL-specific command translation, if you're not using WSL you could replace wsl --terminate Debian with systemctl reboot, or wsl -u root with logging on as root to a freshly rebooted system.
Here's how I solved the libc mismatch problem I was having:
I downloaded libc6 and libcrypt .deb files from a local Debian mirror and installed them manually.
If having trouble executing privileged commands, as I was due to the libc mismatch, you can run wsl -u root to enter the WSL container (in regular Debian, simply login as root user directly).
Inside WSL, create a folder for your .debs and use wget to get these two files (links are amd64 versions):
libc6 2.34: http://ftp.us.debian.org/debian/pool/main/g/glibc/libc6_2.34-4_amd64.deb
libcrypt1_4.4.28-2: http://ftp.us.debian.org/debian/pool/main/libx/libxcrypt/libcrypt1_4.4.28-2_amd64.deb
If you don't have wget, and obviously can't run apt in order to install it, you'll have to try curl -O $LINK, or download a binary distribution of either (Google for it).
Install libc first using dpkg:
# dpkg -i libc6_2.34-4_amd64.deb
Then install libcrypt:
# dpkg -i libcrypt1_4.4.18-4_amd64.deb
After a big OS infrastructure update like libc, exit WSL prompt and run wsl --terminate Debian from CMD prompt (or reboot machine if not WSL), then enter again with wsl -u root (or login as root if not WSL). This is basically as close as you can get to a reboot in WSL.
Then try running apt dist-upgrade -y (make sure you're refreshed your apt cache recently using apt update prior), and it should pull the rest of your system up to the new dependency plateau created by installing libc6 2.34 for Bookworm.
Basically, the idea here is to add as many packages as necessary before you can run an upgrade automatically. For me it took these two packages.
If you get a message to run apt --fix-broken install, try it, then try apt dist-upgrade again.
Contrary to other instructions that say run apt upgrade before apt dist-upgrade, that shouldn't be necessary now since you've already installed the big pieces. You can do it first if you want to, or run into problems, though.
I also ran into this little snafu:
Preparing to unpack .../util-linux_2.38.1-1_amd64.deb ...
Unpacking util-linux (2.38.1-1) over (2.29.2-1+deb9u1) ...
dpkg: error processing archive /var/cache/apt/archives/util-linux_2.38.1-1_amd64.deb (--unpack):
trying to overwrite '/bin/findmnt', which is also in package mount 2.29.2-1+deb9u1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/util-linux_2.38.1-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
TL;DR if you just want the command, I put it under spoiler towards the end. If you'd rather follow the process of how I got there, read on ...
This could basically happen with any number of packages, in this case it's trying to install util-linux with an incompatible version of mount installed. To verify this was the case, I ran this little for loop, which checks upgradable packages for the two conflicting packages, respectively (the 2>/dev/null filters out that annoying WARNING: Cli interface blah blah message):
# for i in util-linux mount; do apt list --upgradable 2>/dev/null | grep $i; done
util-linux/unstable 2.38.1-1 amd64 [upgradable from: 2.29.2-1+deb9u1]
mount/unstable 2.38.1-1 amd64 [upgradable from: 2.29.2-1+deb9u1]
If your conflicting packages are different, just make $i reflect whichever packages you're checking your apt list --upgradable list for, such as for systemd systemd-resolved; do ... or whatever the package names may be.
If they both show up in the list, bingo, they need to be installed using different timing, or in my case needed to overwrite one or the other while a conflicting version was installed.
dpkg has a flag called --force-overwrite, but how to run in apt? The -o flag!
# apt -o Dpkg::Options::="--force-overwrite" --fix-broken install
spoiler You should probably add it to your dist-upgrade way back towards the beginning
# apt -o Dpkg::Options::="--force-overwrite" dist-upgrade
After all that, reboot your system (exit, C:\> wsl --terminate Debian) and enter it again, this time as your normal user, and see if stuff like sudo and passwd work now.
Can also check to see if the upgrade is reflected:
$ clear && uname -a; cat /etc/debian_version; cat -n /etc/os-release
Linux marmot 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 GNU/Linux
bookworm/sid
1 PRETTY_NAME="Debian GNU/Linux bookworm/sid"
2 NAME="Debian GNU/Linux"
3 ID=debian
4 HOME_URL="https://www.debian.org/"
5 SUPPORT_URL="https://www.debian.org/support"
6 BUG_REPORT_URL="https://bugs.debian.org/"
Install neofetch for more fun identification:
$ neofetch
_,met$$$$$gg. avery@marmot
,g$$$$$$$$$$$$$$$P. ------------
,g$$P" """Y$$.". OS: Debian GNU/Linux bookworm/sid on Windows 10 x ,$$P' `$$$. Kernel: 5.10.102.1-microsoft-standard-WSL2
',$$P ,ggs. `$$b: Uptime: 22 hours, 27 mins
`d$$' ,$P"' . $$$ Packages: 399 (dpkg)
$$P d$' , $$P Shell: bash 5.2.0
$$: $$. - ,d$$' Terminal: Windows Terminal
$$; Y$b._ _,d$P' CPU: Intel i5-6300U (4) @ 2.495GHz
Y$$. `.`"Y$$$$P"' Memory: 71MiB / 6219MiB
`Y$$
`Y$$.
`$$b.
`Y$$b.
`"Y$b._
Hope this helps someone.