Install R (last version) from CRAN in Xubuntu

The following is a post/manual based on on the description of the installation process of R from CRAN (link). But I added the results of my experience.

First of all, it is needed to add the CRAN (or alternative) repository to the sources.list file. Edit /etc/apt/sources.list and add to it:

deb http://FAVORITE.CRAN.MIRROR/bin/linux/ubuntu trusty/

Changing FAVORITE.CRAN.MIRROR for one of the list. An example could be:

deb trusty/

Now we update the repositories with:

sudo apt-get update

As a result we got a list of completed update but an error when the system tries to get the information for the added repository:

W: GPG error: trusty/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY XXXXXXXX12345678

To add the key to the system we do:

sudo apt-key adv --keyserver --recv-key 12345678

Just see that we add the last eight digits from the given key, not all. Now we can redo a:

sudo apt-get update

And we can install R with:

sudo apt-get upgrade
sudo apt-get install r-base

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: