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>.

Answer from singrium on askubuntu.com
🌐
Debian
packages.debian.org › sid › libc6
Debian -- Details of package libc6 in sid
Contains the standard libraries that are used by nearly all programs on the system. This package includes shared versions of the standard C library and the standard math library, as well as many others · Tags: Role: Shared Library
Debian Packages Search
This site provides you with information about all the packages available in the Debian Package archive · Please contact Debian Webmaster if you encounter any problems
List of sections in "trixie"
Limit to suite: [bullseye] [bullseye-updates] [bullseye-backports] [bookworm] [bookworm-updates] [bookworm-backports] [trixie] [trixie-updates] [trixie-backports] [forky] [sid] [experimental] · Limit to a architecture: [alpha] [amd64] [arm] [arm64] [armel] [armhf] [avr32] [hppa] [hurd-i386] ...
List of sections in "bookworm"
Limit to suite: [bullseye] [bullseye-updates] [bullseye-backports] [bookworm] [bookworm-updates] [bookworm-backports] [trixie] [trixie-updates] [trixie-backports] [forky] [sid] [experimental] · Limit to a architecture: [alpha] [amd64] [arm] [arm64] [armel] [armhf] [avr32] [hppa] [hurd-i386] ...
🌐
Debian
packages.debian.org › libc6
Debian -- Package Search Results -- libc6
I Challenge Thee · AI scrapers break the web, to use this page you'll need JavaScript enabled
🌐
Pkgs.org
pkgs.org › download › libc6
Libc6 Download (DEB, RPM)
Download libc6 packages for Debian, OpenMandriva, Ubuntu
🌐
Reddit
reddit.com › r/debian › killed my system by accidentally upgrading libc6 to sid version.
r/debian on Reddit: Killed my system by accidentally upgrading libc6 to sid version.
March 2, 2024 -

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.

Top answer
1 of 3
15

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>.

2 of 3
7

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.

🌐
Debian
packages.debian.org › libc6-amd64
Debian -- Package Search Results -- libc6-amd64
JavaScript is disabled in your browser · Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
🌐
Debian
packages.debian.org › bullseye-updates › libc6
Debian -- Details of package libc6 in bullseye-updates
Contains the standard libraries that are used by nearly all programs on the system. This package includes shared versions of the standard C library and the standard math library, as well as many others · Tags: Role: Shared Library
Find elsewhere
🌐
Debian
packages.debian.org › sid › i386 › libc6-dev
Details of package libc6-dev in sid
JavaScript is disabled in your browser · Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
Top answer
1 of 1
2

Debian 9.x "stretch" uses version 2.24 of libc6. The current version is 2.24-11+deb9u4, i.e. it includes a lot of patches and backported security bugfixes compared to upstream version 2.24. The deb9u4 part indicates this packaged version may have some dependencies requiring the system as a whole to be at Debian 9.4 or above.

Warning: libc6 is a pretty fundamental package that is used by essentially all system binaries. Debian buster (i.e. the current testing) has version 2.28 of libc6, but you should not install it to stretch.

Don't make a FrankenDebian

Debian Stable should not be combined with other releases. If you're trying to install software that isn't available in the current Debian Stable release, it's not a good idea to add repositories for other Debian releases. The problems might not happen right away, but the next time you install updates.

The reason things can break is because the software packaged for one Debian release is built to be compatible with the rest of the software for that release. For example, installing packages from buster on a stretch system could also install newer versions of core libraries including libc6. This results in a system that is not testing or stable but a broken mix of the two.

What you are trying to do is exactly "installing a newer version of core library libc6". This is known to break things. Don't do it (unless you're updating the entire system to buster of course).

If an application requires libc6 version 2.28 or higher, then it is not compatible with Debian 9.

🌐
Debian
packages.debian.org › source › bullseye › glibc
Debian -- Details of source package glibc in bullseye
libc6-dev-i386 · GNU C Library: 32-bit development libraries for AMD64 · libc6-dev-x32 · GNU C Library: X32 ABI Development Libraries for AMD64 · libc6-i386 · GNU C Library: 32-bit shared libraries for AMD64 · libc6-udeb · GNU C Library: Shared libraries - udeb ·
🌐
Debian
packages.debian.org › bullseye › libc6-dev-amd64
Debian -- Details of package libc6-dev-amd64 in bullseye
[glibc_2.31-13+deb11u13.debian.tar.xz] GNU Libc Maintainers (QA Page, Mail Archive) Clint Adams (QA Page) Aurelien Jarno (QA Page) Adam Conrad (QA Page) Samuel Thibault (QA Page) Homepage [www.gnu.org] libc6-dev-amd64-i386-cross · libc6-dev-amd64-x32-cross ·
Top answer
1 of 2
6

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:

  1. 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 contrib
    

    replace it with:

    deb http://deb.debian.org/debian buster main non-free contrib
    

    since buster isn't the testing distribution any more (bullseye is).

  2. Update the list of packages:

    apt update
    
  3. Upgrade your libc6 to the version from buster:

    apt install libc6/buster libc6-dev/buster libc-dev-bin/buster
    
  4. Consider 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.

2 of 2
0

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.

🌐
Debian
packages.debian.org › sid › libc6-dev-amd64
Debian -- Details of package libc6-dev-amd64 in sid
GNU C Library: Development Libraries and Header Files also a virtual package provided by libc6.1-dev ... Български (Bəlgarski) dansk Deutsch suomi français magyar Italiano 日本語 (Nihongo) Nederlands polski Português (br) Русский (Russkij) slovensky svenska Türkçe українська (ukrajins'ka) 中文 (Zhongwen,简) 中文 (Zhongwen,繁) See our contact page to get in touch. Content Copyright © 1997 - 2026 SPI Inc.; See license terms. Debian is a trademark of SPI Inc.
🌐
Debian
packages.debian.org › sid › libc6-dbg
Details of package libc6-dbg in sid
I Challenge Thee · AI scrapers break the web, to use this page you'll need JavaScript enabled
🌐
Debian
packages.debian.org › bookworm › libc6-i386
Debian -- Details of package libc6-i386 in bookworm
JavaScript is disabled in your browser · Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
🌐
Debian
packages.debian.org › bullseye › s390x › libc6
Details of package libc6 in bullseye
All packages (compact compressed textlist) · This page is also available in the following languages (How to set the default document language):
🌐
Pkgs.org
pkgs.org › download › libc6-i386
Libc6-i386 Download (DEB, RPM)
Download libc6-i386 linux packages for Debian, PCLinuxOS, Ubuntu
🌐
Debian
packages.debian.org › sid › libc6-udeb
Debian -- Details of package libc6-udeb in sid
[glibc_2.42-13.debian.tar.xz] GNU Libc Maintainers (QA Page, Mail Archive) Clint Adams (QA Page) Aurelien Jarno (QA Page) Samuel Thibault (QA Page) libc6.1-udeb · libc6 · libc6.1 · libc6-s390 · libc6-amd64 · libc6-mips32 · libc6-mipsn32 · libc6-mips64 ·
🌐
Debian
packages.debian.org › bookworm › libc6
Debian -- Details of package libc6 in bookworm
Contiene las bibliotecas estándar que utiliza casi cualquier programa en el sistema. Este paquete incluye las bibliotecas compartidas de la biblioteca estándar de C y de la biblioteca estándar de matemáticas, así como muchas otras bibliotecas · Tags: Role: Shared Library