Name Last modified Size Description
Parent Directory -
README 31-Oct-2011 22:20 9.0K
README.html 31-Oct-2011 22:20 11K
etch-cran/ 07-May-2010 14:38 -
lenny-cran/ 22-Dec-2011 22:28 -
squeeze-cran/ 22-Dec-2011 22:27 -
R packages for the base system have been part of the Debian distribution since 1997. R, as well as many add-on packages (from CRAN and others repositories) are available via the regular Debian distribution mechanisms. Hence, running
apt-cache search ^r-.*
should get you started with a list of available packages.
After a release of Debian "stable", no new packages get added by Debian to keep the release as 'stable' as possible. This implies that the R release contained in the official Debian release will become outdated as time passes. As a courtesy to the R users on the Debian "stable" platforms, the "stable" directory on CRAN contains so-called 'backports' of the current R binaries for the "stable" distribution of Debian.
For a backport of the latest R release to squeeze, simply add something like
deb http://<favorite-cran-mirror>/bin/linux/debian squeeze-cran/
to the file /etc/apt/sources.list on your computer and install as usual. Note that you need to substitute <favorite-cran-mirror> by one of the mirror URLs listed in
http://cran.r-project.org/mirrors.html
There are binaries for the i386 and amd64 architectures. You can use the source packages from
deb-src http://<favorite-cran-mirror>/bin/linux/debian squeeze-cran/
to compile binaries for other platforms.
With an appropriate entry in /etc/apt/sources.list, the newest R release can be installed using a command sequence like
apt-get update apt-get install r-base r-base-dev
While updating your package lists you might get a warning about a missing key, telling you that the integrity of packages can not be verified. You can ignore this if you trust the CRAN servers and continue with the installation. Otherwise, please refer to the section on secure apt below.
You only need r-base-dev if you want to compile R packages yourself or other software depending on R (see section below on administration and maintenance). Be aware that you may also have to install build dependencies (typically -dev packages containing headers). The list r-sig-debian is a good place to ask if you run into problems.
Special note for R 2.14.0: After installing R 2.14.0 or greater, some packages that are present on your system may fail to load, if they do not contain a namespace and if they were installed using a prior version. Reinstalling them from a source package will solve the problem. See the first entry for R 2.14.0 in http://cran.r-project.org/src/base/NEWS.html
For a backport of the latest stable R version to lenny, simply add something like
deb http://<favorite-cran-mirror>/bin/linux/debian lenny-cran/
to the file /etc/apt/sources.list on your computer and install as usual. There are binaries for the i386 and amd64 architectures. You can use the source packages from
deb-src http://<favorite-cran-mirror>/bin/linux/debian lenny-cran/
to compile binaries for other platforms.
Note for R versions starting from 2.11.0: After installing a version greater than R 2.10.X from CRAN, you will have to update or reinstall all R packages that have been installed with an R version lower than R 2.10.X, as they will not work with the new help system. This will be the case for any r-cran-* debian packages from the lenny distribution that you may still be using.
Before R 2.12.2, when squeeze was not released yet, I proposed apt-pinning for installing up-to-date R packages from unstable (sid) on squeeze by creating a file /etc/apt/preferences containing
Package: * Pin: release a=testing Pin-Priority: 650 Package: * Pin: release a=unstable Pin-Priority: 600
and adding a line for unstable in /etc/apt/sources.list. As the new testing distribution with codename wheezy is not frozen, you can remove or uncomment these entries, except if you want to have the latest R version on wheezy before it migrates from unstable to testing.
For a backport of R 2.11.0 to etch, simply add something like
deb http://<favorite-cran-mirror>/bin/linux/debian etch-cran/
to the file /etc/apt/sources.list on your computer and install as usual. There are binaries for the i386 and amd64 architectures. You can use the source packages from
deb-src http://<favorite-cran-mirror>/bin/linux/debian etch-cran/
to compile binaries for other platforms.
A number of R packages are available from the Debian repositories with names starting with r-cran-. Note, however, that only the packages part of the r-recommended set are kept up-to-date on CRAN. Currently, these are:
r-cran-boot r-cran-cluster r-cran-class r-cran-codetools r-cran-foreign r-cran-kernsmooth r-cran-lattice r-cran-mass r-cran-matrix r-cran-mgcv r-cran-nlme r-cran-nnet r-cran-rmatrix r-cran-rpart r-cran-spatial r-cran-survival
Because they rely on the installed version of R, I also provide versions of the following packages:
littler r-cran-rodbc python-rpy (squeeze only) rkward (squeeze only) r-cran-jags (squeeze only)
The Debian backports archives on CRAN are signed with the key of "Johannes Ranke (CRAN Debian archive) <jranke@uni-bremen.de>" with key ID 381BA480. You can fetch this with
gpg --keyserver subkeys.pgp.net --recv-key 381BA480
or alternatively, using another key server,
gpg --keyserver pgp.mit.edu --recv-key 381BA480
If this doesn't work, it might be due to a firewall blocking port 11371. Alternatively, you can search for 0x381BA480 at http://keyserver.noreply.org/ and copy the key block into a plain text file, named, for instance, jranke_cran.asc.
If receiving the key with gpg did work, you need to export it to a text file
gpg -a --export 381BA480 > jranke_cran.asc
In both cases you need to make the key known to the apt system by running
apt-key add jranke_cran.asc
as root.
The R packages part of the r-base and r-recommended packages are installed into the directory /usr/lib/R/library. These can be updated using usual package maintenance tools like apt-get or aptitude.
The other R packages precompiled as Debian packages r-cran-* are installed into /usr/lib/R/site-library.
The command
apt-cache rdepends r-base-core
shows all packages that depend on r-base-core; this comprises a large number of contributed packages from CRAN and other repositories.
If you want to install R packages not provided as Debian packages, or if you want to use newer versions, you need to build them from source which requires the development package r-base-dev that can be installed by
apt-get install r-base-dev
This makes sure that you have the basic requirements for compiling R packages. R packages may then be installed by the local user/admin from the CRAN source packages, typically from inside R using the
> install.packages()
function or using R CMD INSTALL from a shell. If you have proper write permissions in /usr/local/lib/R/site-library/, and you have not set R_LIBS_USER manually, they will be installed there. Otherwise, you will be asked if a directory in your home directory should be created for these packages. A routine update of such locally compiled packages can be done using
> update.packages(.libPaths()[1])
which will update the packages in the first part of your library path. You can have a look at the components of this part by
> libPaths()
If you would like to update R packages that have been installed via the Debian package management system which are installed somewhere under /usr/lib/, I would recommend to do this the Debian way using the source packages from Debian unstable.
In order to find packages, R looks at the variables R_LIBS_USER and R_LIBS_SITE. On Debian and Ubuntu, R_LIBS_USER is set in /etc/R/Renviron to
R_LIBS_USER=${R_LIBS_USER-'~/R/$platform-library/2.11'}
where $platform is something like 'x86_64-pc-linux-gnu'. You can override this in ~/.Renviron. R_LIBS_SITE is set in /etc/R/Renviron to
R_LIBS_SITE=${R_LIBS_SITE-'/usr/local/lib/R/site-library:/usr/lib/R/site-library:/usr/lib/R/library'}
This means that packages installed from within R take precedence over the ones installed via the Debian package management system if you happen to have two versions installed at the same time.
The best place to report problems with these packages or ask R questions specific to Debian is the R-SIG-Debian mailing list. See
https://stat.ethz.ch/mailman/listinfo/r-sig-debian
for more information.
Anyone interested in building Debian packages (e.g. for an unsupported release, another architecture or an old R version) can have a look at the build scripts used by the current maintainer. These are available anonymously from the Subversion repository
http://kriemhild.uft.uni-bremen.de/viewvc/r-backports
The scripts contain small changes needed to compile the original Debian packages on the supported release.
The Debian R packages are maintained by Dirk Eddelbuettel. The packages present on CRAN for Debian stable and oldstable are provided by Johannes Ranke.