Search This Blog

Tuesday, July 14, 2015

Upgrading R to latest version on Ubuntu

I am using a LTS version of Ubuntu on my machine so the R I was using was not the latest. You can check the installed version of R on your machine simply by typing the following command.

$ R

As you can see the version of R was 3.0.2, where as the latest version of R was 3.2.1




To update R, add your favourite cran mirror to your sources. Enter following command to access sources

$ sudo gedit /etc/apt/sources.list



Add the following line to the end of your file, For me it was the berkley mirror.

deb http://cran.cnr.berkeley.edu/bin/linux/ubuntu trusty/


Next, run the following commands, to obtain the key

$ gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9


Next we add the key to apt-key

$ gpg -a --export E084DAB9 | sudo apt-key add -


Next we run update, and install r-base

$ sudo apt-get update
$ sudo apt-get install r-base


Next, we can check the version of R to confirm


Yup, we have the latest version

No comments: