I want to be able to install the latest stable R release for Ubuntu 18.04, I had the ubuntu version installed and so I removed it and then followed several guides like in this link.

No matter what I do I get the following output when I issue a sudo apt-get install r-base:

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-base-core (>= 3.6.1-3disco) but it is not going to be installed
          Depends: r-recommended (= 3.6.1-3disco) 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.

What's wrong? (I did all the apt update etc.)


For anyone that experiences the same problem, I found the solution in: Unable to install R 3.5.0 in Ubuntu Bionic Beaver (18.04)

I simply issued these commands in order and then was able to install:

  1. Temporarily removed deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ from /etc/apt/sources.list
  2. sudo apt-get autoremove sudo apt-get update sudo apt-get upgrade
  3. Added back deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ to /etc/apt/sources.list
  4. sudo apt-get update
  5. sudo apt-get install r-base

And that was it (installed R 3.6.1).

  • amazing-it worked, there were so many tutorials requesting an elaborate set of steps, many said that it was necessary to update my distribution even – Vass Aug 13 '20 at 2:07

This solution worked for me: https://linuxize.com/post/how-to-install-r-on-ubuntu-18-04/

  1. Install the packages necessary to add a new repository over HTTPS:

sudo apt install apt-transport-https software-properties-common

  1. Enable the CRAN repository and add the CRAN GPG key to your system using the following commands:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9

sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'

  1. Now that the apt repository is added, update the packages list and install the R package by typing:

sudo apt update sudo apt install r-base

  1. To verify that the installation was successful run the following command which will print the R version:

R --version

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.