Friday, May 8, 2015

Install R on Ubuntu 14.04

Update your local repository
sudo apt-get update
sudo vi /etc/apt/sources.list
Check http://cran.r-project.org/mirrors.html for the list of CRAN mirrors.
In the end of the file paste the below content
deb http://cran.rstudio.com/bin/linux/ubuntu trusty/
If your mirror is different from http://cran.rstudio.com then use
deb <mirror>/bin/linux/ubuntu trusty/
save and close

Update your local repositories with added libraries
sudo apt-get update*
Install R base and dev libraries
sudo apt-get install r-base-dev r-base



*If in case you face an error during update like
W: GPG error: http://cran.rstudio.com trusty/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 51716619E084DAB9

then try the following commands

gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-key 51716619E084DAB9
gpg -a --export 51716619E084DAB9| sudo apt-key add -

Update your repositories again
sudo apt-get update
Install R base and dev libraries
sudo apt-get install r-base-dev r-base

Please note the public key should be the same as in error.

No comments:

Post a Comment