Stable Debian, new R

To get the new R with the Debian stable, here's what you do.

http://rweb.quant.ku.edu/cran/bin/linux/debian/

In your system's directory for addon repositories, /etc/apt/sources.list.d, you create a file with a name "R.list" (must be "list" on the end" and in there you put this instruction.

deb http:///bin/linux/debian squeeze-cran/

I suggest replace with "rweb.quant.ku.edu/cran"

then as root (type "su -" in terminal)

$ apt-get update

$ apt-get install r-base r-base-dev

This will come back with some hassle about installing insecure packages because we have not "bothered" with getting the security key for that apt package maintainer. The procedure described in the web page under "Secure Apt" was bumpy. For me, the gpg was not able to directly import the key, so I had to do:

gpg -a --export 381BA480 > jranke_cran.asc

apt-key add jranke_cran.asc

After R is installed, be aware of this issue. The R core team's packages are installed under /usr/lib/R/library. Other packages that have been turned into debian packages will go under /usr/local/lib/R/site-library. If the non-root user runs install.packages, then the system will invite the user to install them in his home directory, under ~/R/. SO the R system has a complicated set of paths to survey when it looks for packages, and it is a possibility (danger?) that there may be several installed. For example, if the Debian packager has made a package that gets installed under /usr/local/lib/R/site-library, and then a user notices that is old, the user can run install.packages and a newer version will get dropped into ~/R. However, if the system administrator comes along and updates the Debian packages, then the one in the system may be newer.

Also remember, after updating your R packages, consider making 2 steps.

1. Use apt-get (or synaptic) to make sure you are up-to date on other R packages that have been turned into debian packages.

2. Run R as root and do this:

> update.packages(ask=F, checkBuilt=TRUE, dep=TRUE)

That forces re-installation of packages that were built under old R.

About pauljohn

Paul E. Johnson is a Professor of Political Science at the University of Kansas. He is an avid Linux User, an adequate system administrator and C programmer, and humility is one of his greatest strengths.
This entry was posted in Linux. Bookmark the permalink.