Ubuntu – Apt unmet dependencies while installing R on Ubuntu 16.04


I wanted to install the new R version so I did a purge by removing all r-*. And then I broke everything unfortunately. I try to reinstall R project by typing

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

and then I obtain

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.27) but 2.23-0ubuntu11 is to be 
               Depends: libcurl4 (>= 7.28.0) but it is not installable  
               Depends: libicu60 (>= 60.1-1~) but it is not installable  
               Depends: libreadline7 (>= 6.0) but it is not installable  
               Recommends: r-base-dev but it is not going to be installed  
E: Unable to correct problems, you have held broken packages.

Does anyone know how to solve this ?

Best Answer

My problem is solved.

I had put the wrong source in my sources.list to download the latest version of R. Following the instructions given in https://cloud.r-project.org/, I had put deb https://cloud.r-project.org/bin/linux/ubuntu cosmic-cran35/ instead of deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/.

By modifying the source, everything works fine now.

Related Question