Installing r-base on Zorin OS (libc6 2.35 needed)

I'm trying to install the R programming language on Zorin OS 16.3 Lite (the one with the xcfe desktop). I've been following the official installation instructions (linked below).

When I run

sudo apt-get install r-base

I get the following output:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 r-base : Depends: r-base-core (>= 4.3.1-4.2204.0) but it is not going to be installed
          Depends: r-recommended (= 4.3.1-4.2204.0) but it is not going to be installed
          Recommends: r-base-html but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

After some troubleshooting I'm pretty sure there's a dependency problem with r-base-core. Running

sudo apt-install r-base-core r-recommended --simulate

gives the following output:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 r-base-core : Depends: libc6 (>= 2.35) but 2.31-0ubuntu9.9 is to be installed
               Depends: libicu70 (>= 70.1-1~) but it is not installable
               Recommends: r-base-dev but it is not going to be installed
               Recommends: r-doc-html but it is not going to be installed
 r-recommended : Depends: r-cran-mgcv (>= 1.1.5) but it is not going to be installed
                 Depends: r-cran-nlme (>= 3.1.52) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

libc6 2.35 or greater is required, but my system has 2.31 installed. According to a thread on this forum (Update "libc6" to version 2.34 or newer), updating libc6 isn't really an option. I really need to get this package working as soon as possible. How should I proceed?

official site instructions: Ubuntu Packages For R - Full Instructions
this was also helpful: [Solved] Unable to install R base; unmet dependencies on | 9to5Answer

That's a bit of a sticky situation, and it's been on-going for years.

Don't just install libc6 2.35 alongside 2.31... it'll crash your system, most likely. You have to change the path of 2.35 (put it somewhere else than default), then change the path in the R programming language so it references that 'somewhere else'. That's a lot of work, and you don't have to do it.

Do this instead... follow the directions here:
https://cloud.r-project.org/bin/linux/ubuntu/

Issue this command:
sudo add-apt-repository ppa:c2d4u.team/c2d4u4.0+

Then find the package for Focal Fossa (which is Linux 20.04, which Zorin OS currently uses). It should attempt to use libc6 2.31.

Alternatively, you can try using the Debian packages:
https://cloud.r-project.org/bin/linux/debian/

2 Likes

Thank you so much for responding. I've added the cran2deb repository and checked the launchpad page (cran2deb4ubuntu 4.0 : “cran2deb4ubuntu Build Team” team), but there are a few thousand packages listed and I'm not sure which one I need. From what I can tell most of them are libraries or addons for R

Try

http://ppa.launchpad.net/c2d4u.team/c2d4u4.0+/ubuntu/pool/main/r/r6/r-cran-r6_2.5.1-1cran1.2204.0_all.deb

From that cran repo...

That gives me a similar dependency error:

$ sudo dpkg -i r-cran.deb
(Reading database ... 283710 files and directories currently installed.)
Preparing to unpack r-cran.deb ...
Unpacking r-cran-r6 (2.5.1-1cran1.2204.0) over (2.5.1-1cran1.2204.0) ...
dpkg: dependency problems prevent configuration of r-cran-r6:
 r-cran-r6 depends on r-base-core; however:
  Package r-base-core is not installed.

dpkg: error processing package r-cran-r6 (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 r-cran-r6

That is strange... I installed that package to be sure it works before I posted the link.
Try:

sudo apt install r-base r-base-dev

Then re-run the .deb

I also install .deb packages with Gdebi.

apt install r-base r-base dev gives the same dependency error as in the original post

Let's see the terminal output of sudo apt update

Since we had different results- I wonder if you have added another repository.

It gives:

Hit:1 http://ppa.launchpad.net/bartbes/love-stable/ubuntu focal InRelease      
Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]      
Get:3 http://ppa.launchpad.net/c2d4u.team/c2d4u4.0+/ubuntu focal InRelease [18.1 kB]
Hit:4 http://us.archive.ubuntu.com/ubuntu focal InRelease                      
Get:5 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ InRelease [3,626 B]
Get:6 https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/ InRelease [3,626 B]
Get:7 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]     
Hit:8 http://ppa.launchpad.net/easymodo/qimgv/ubuntu focal InRelease           
Hit:9 https://packages.zorinos.com/stable focal InRelease                      
Get:10 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]  
Hit:11 https://packages.zorinos.com/patches focal InRelease                    
Hit:12 https://packages.zorinos.com/apps focal InRelease                       
Hit:13 http://ppa.launchpad.net/zorinos/apps/ubuntu focal InRelease            
Get:14 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [59.9 kB]
Hit:15 https://packages.zorinos.com/drivers focal InRelease                    
Hit:16 http://ppa.launchpad.net/zorinos/drivers/ubuntu focal InRelease         
Get:17 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [96.5 kB]
Hit:18 http://ppa.launchpad.net/zorinos/patches/ubuntu focal InRelease         
Get:19 http://us.archive.ubuntu.com/ubuntu focal-updates/main i386 Packages [885 kB]
Get:20 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 DEP-11 Metadata [940 B]
Get:21 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [2,854 kB]
Get:22 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [274 kB]
Get:23 http://us.archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata [415 kB]
Get:24 http://us.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [944 B]
Get:25 http://ppa.launchpad.net/zorinos/stable/ubuntu focal InRelease [18.1 kB]
Get:26 http://us.archive.ubuntu.com/ubuntu focal-backports/main amd64 DEP-11 Metadata [7,996 B]
Get:27 http://us.archive.ubuntu.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata [30.5 kB]
Get:28 http://ppa.launchpad.net/c2d4u.team/c2d4u4.0+/ubuntu focal/main amd64 Packages [988 kB]
Get:29 http://ppa.launchpad.net/c2d4u.team/c2d4u4.0+/ubuntu focal/main i386 Packages [666 kB]
Get:30 http://ppa.launchpad.net/c2d4u.team/c2d4u4.0+/ubuntu focal/main Translation-en [1,250 kB]
Fetched 7,909 kB in 7s (1,126 kB/s)                                            
Reading package lists... Done
Building dependency tree       
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.

Here is your trouble. You have Bionic and Jammy sources added in addition to Focal.
These are different versions and they will call on different dependencies.

Please stick only with Focal (Fossa) repositories on Zorin OS 16.

Remove the two troublesome repositories either by using the Software & Updates app or by elevating to root and navigating to /etc/apt/sources.list.d directory to find and remove them.
You must keep the ppa.launchpad.net/c2d4u.team/c2d4u4.0+/ubuntu focal InRelease repository as it is correct.

Once done, run sudo apt update to get your sources updated to the existing repositories on your system. You might run sudo apt clean && sudo apt autoremove just to give yourself a bit more peace of mind.

$ ls /etc/apt/sources.list.d
bartbes-ubuntu-love-stable-focal.list        easymodo-ubuntu-qimgv-focal.list.save  zorinos-ubuntu-apps-focal.list          zorinos-ubuntu-patches-focal.list.save
bartbes-ubuntu-love-stable-focal.list.save   r-project.list                         zorinos-ubuntu-apps-focal.list.save     zorinos-ubuntu-stable-focal.list
c2d4u_team-ubuntu-c2d4u4_0_-focal.list       r-project.list.save                    zorinos-ubuntu-drivers-focal.list       zorinos-ubuntu-stable-focal.list.save
c2d4u_team-ubuntu-c2d4u4_0_-focal.list.save  zorin.list                             zorinos-ubuntu-drivers-focal.list.save
easymodo-ubuntu-qimgv-focal.list             zorin.list.save                        zorinos-ubuntu-patches-focal.list

There don't seem to separate repositories for bionic and jammy. Should I just remove r-project.list?

Yes, since you have c2d4u, that should be fine.

Ok, this is what my output looks like right now:

$ sudo apt update
Hit:1 http://us.archive.ubuntu.com/ubuntu focal InRelease    
Hit:2 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease          
Hit:4 https://packages.zorinos.com/stable focal InRelease                   
Hit:5 https://packages.zorinos.com/patches focal InRelease
Hit:6 https://packages.zorinos.com/apps focal InRelease
Hit:7 https://packages.zorinos.com/drivers focal InRelease
Hit:8 http://security.ubuntu.com/ubuntu focal-security InRelease                                                   
Hit:9 http://ppa.launchpad.net/bartbes/love-stable/ubuntu focal InRelease
Hit:10 http://ppa.launchpad.net/c2d4u.team/c2d4u4.0+/ubuntu focal InRelease
Hit:11 http://ppa.launchpad.net/easymodo/qimgv/ubuntu focal InRelease
Hit:12 http://ppa.launchpad.net/zorinos/apps/ubuntu focal InRelease
Hit:13 http://ppa.launchpad.net/zorinos/drivers/ubuntu focal InRelease
Hit:14 http://ppa.launchpad.net/zorinos/patches/ubuntu focal InRelease
Hit:15 http://ppa.launchpad.net/zorinos/stable/ubuntu focal InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.
$ sudo apt install r-base
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 r-base : Depends: r-recommended (= 3.6.3-2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

apt install r-recommended told me that it had a dependency on r-cran-foreign. apt install r-cran-foreign said it had a dependency on r-base-core. apt install r-base-core worked, but apt install r-base gives, the same error as before. r-cran-foreign now says there's a version problem:

$ sudo apt install r-cran-foreign
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 r-cran-foreign : Depends: r-base-core (>= 4.0.0-1.2004.0) but 3.6.3-2 is to be installed
                  Depends: r-api-4.0 but it is not installable
E: Unable to correct problems, you have held broken packages.

Ok, I was able to the r-cran package you recommended earlier after removing the other repositories, so I think the problem is solved!

1 Like

Glad to hear. I went ahead and moved the Solution mark to @Mr_Magoo 's initial post due to that post containing the suggested solution - everything that followed just needed to straighten out repositories for that solution to work.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.