3

I am trying to install the latest version of R into Ubuntu 16.04.

But somehow it installs 3.4.4 even though latest version of R is 3.6.1. I have also read some articles that state "To obtain the latest R 3.6 packages, add an entry like":

deb https://cloud.r-project.org/bin/linux/ubuntu disco-cran35/

But still I don't understand what should I do with this link.

0

2 Answers 2

5

First, remove the installed version of R using:

sudo apt purge r-base

You should also uninstall any other R packages that you may have installed.

As stated in the R installation guide, for 16.04 you need to add the repository deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/ to /etc/apt/sources.list. There is a longer and a shorter way to do this.

Longer way:

  1. To add the repository open a terminal and run:

    sudo nano /etc/apt/sources.list
    
  2. Copy and paste deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/ at the end of the file (paste is Ctrl+Shift+V for nano).

  3. Then add the public key for the repository running the following command:

    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
    
  4. Finally, update your system to enable the repository:

    sudo apt update
    

Shorter way:

You can add the repository, key and update as a one-line terminal command:

sudo bash -c 'echo "deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/" >> /etc/apt/sources.list' && sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 && sudo apt update

Whichever way you selected, you should be able to install R 3.6 by running:

sudo apt install r-base
0

You can easily do this using the ropenblas package from R. Install the devtools package and then run the following code:

devtools::install_github(repo = "prdm0/ropenblas", force = TRUE)
ropenblas::rcompiler()

See: https://github.com/prdm0/ropenblas#rcompiler-function

Yes, you with ropenblas will be able to compile the latest stable version of the R language. R and Rscript binaries will be created and configured for use in your GNU/Linux distribution. The procedure is the same for any GNU/Linux distribution.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .