Monday 5 November 2012

Installing the latest version of R into Debian Stable

The R packages available in the Debian repository are are little out of date - to install the latest (stable) version we need to add a backports repository. Just follow the steps below!

Open the sources list with:
 sudo nano /etc/apt/sources.list  

Then add this line to the bottom of the file (use your favourite mirror if desired):
 deb http://cran.ma.imperial.ac.uk/bin/linux/debian squeeze-cran/  

The Debian backports are signed with the key of "Johannes Ranke (CRAN Debian archive) <jranke@uni-bremen.de>", with key ID 381BA480 . Import this using:
 sudo apt-key adv --keyserver subkeys.pgp.net --recv-key 381BA480  

Then, update the packages cache - this should complete without errors.
 sudo apt-get update  

Finally, install R and the R recommended packages using:
 sudo apt-get r-base r-recommended   

To check the version of R that is now installed, use:
 R --version  

To start R, simply type
 R  

at a command prompt. As usual, let me know of any issues or problems in the comments below.

No comments:

Post a Comment

Please leave a comment if you find this blog helpful or interesting! I'd love to hear from you!