Ubuntu – How you install R 3.2.2 in Ubuntu 14.04 LTS

14.04debrsoftware installation

I want to install a version of R that is newer than the one in the Ubuntu repos, but older than the most current CRAN version. (How to install/upgrade r-base describes how to install the latest version and I want an older one).

I keep trying but nothing. I downloaded the .deb file but it asks me for a numerous dependencies. Does anyone know any other faster way?

Best Answer

I don't know of a "good/"easy" way to get an intermediate version of R (one between the Ubuntu repo version and the current one), but you have a few options:

  1. You will likely need to install dependencies anyway, so you could try installing from deb. If you only need the one version installed on your system, this may be the way to go. Install it using gdebi, which automatically resolves dependencies for you (first sudo apt-get install gdebi-core; then sudo gdebi packageName.deb).

  2. You can attempt to build from source, but that can be a pain. The upside is that you can have multiple versions of R installed this way by specifying a --prefix=/path/to/use in the ./configure step (see here).

    wget https://cran.rstudio.com/src/base/R-3/R-3.2.2.tar.gz
    tar xvf R-3.1.1.tar.gz
    cd R-3.2.2
    ./configure
    make && make install
    
  3. If you are familiar with Docker, you can get version-specific R images:

    docker pull r-base:3.2.2
    

    then

    docker run -it --rm r-base:3.2.2