36

When I type

sudo apt-get install r-base-core

I get the following error

The following packages have unmet dependencies. r-base-core : Depends: libc6 (>= 2.29) but 2.27-3ubuntu1 is to be installed

Now libc6 as far as I understand is an important library which should not be removed.

So how to upgrade from the current version (2.27) to any version >= 2.29?

2 Answers2

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

singrium
  • 6,880
  • 7
    I think this is not safe! Look out people what you are doing!! You can run multiple glibc (libc) versions on 1 system. HOWEVER.. keep in mind to put them in to a different folder. And use PatchELF tool to change the path, or change the dynamic linker path during the build. – Melroy van den Berg Jan 13 '20 at 21:27
  • 3
    @danger89 please post an answer with more details, thank you. Or you can suggest edits to my answer in order to fix the problem. – singrium Jun 01 '20 at 16:16
  • 1
    @singrium, Link is not available now – Gary Chen Oct 27 '20 at 12:33
  • 2
    @XueQing Check the links posted in the edit of 06/01/2020. I check both links and they work. – singrium Oct 27 '20 at 13:10
  • 3
    don't do it, it has broken my system to the point it cannot even boot https://askubuntu.com/questions/1314766/whole-system-is-broken-after-failed-libc6-upgrade-attempt – overdriven Feb 08 '21 at 21:05
  • 1
    NOT SAFE. This approach sudo dpkg --auto-deconfigure -i libc6_2.31-0ubuntu9.4_amd64.deb crashed my sudo setup and my system is crashed. I cannot even run sudo // sudo: pam_open_session: Module is unknown sudo: policy plugin failed session initialization. – alper Feb 10 '22 at 11:44
  • @alper Thank you for reporting this, I have added a warning that this method let to systems crashing for some users. – singrium Feb 10 '22 at 11:52
  • This is a manual installation of libc6 package, I think it's not safe, that's why we're using sudo apt update and sudo apt upgrade But none of these too didn't worked for me, for this matter – Damika Jan 03 '24 at 08:20
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.

alper
  • 222
AlfCano
  • 71
  • 1
  • 3
  • glibc uses versioned symbols. Newer versions are usually very good at being backwards compatible with programs that were linked with an older version. Still, caution is advisable of course. – Thomas Jan 04 '21 at 10:18