Installing the Development Version of R on Ubuntu (alongside the current version of R)

A recent question was asked on the R-sig-Debian on installing the development version of R alongside the stable version. While most users of R do not need to have two versions installed on their machine, it is useful if you are developing packages for CRAN and want to test your package.

The latest development version of R is not available as a Ubuntu package, so it will need to be built from source. Before you build from source, you will need to make sure that all the compilers and libraries needed to build R are available. Since the development version is similar to the current version of R, the following commands will install all the packages you need (plus a couple more).

 sudo apt-get build-dep r-base sudo apt-get install subversion ccache 

The next steps were suggested by Dirk Eddelbuettel. First, you need to download the current version of r-devel from svn. Create a directory for the r-devel code. The scripts below use the path “~/svn” and if you want to change the location, you will need to make the appropriate changes in all the scripts.

 mkdir ~/svn/ 

Now checkout the current r-devel code from svn.

 cd ~/svn/ svn co https://svn.r-project.org/R/trunk r-devel/R 

The svn checkout will take some time. Next you need a script that will build r-devel, but install it in a location different from the stable version of R. Again, thanks to Dirk, here is that script. Note that the executable is installed in “/usr/local/lib/R-devel/bin”, but that can be changed.

A second script (that you should place in the appropriate location) will allow you to easily launch the development version of R.

One thought on “Installing the Development Version of R on Ubuntu (alongside the current version of R)

  1. Pingback: Installing R-devel on Linux (Ubuntu/Mint) | Henrik Singmann

Leave a Reply