Install R in Ubuntu and upgrade to latest version



The video describes how you can install R in ubuntu 14.04 (Trusty Tahr). While you install this from the Ubuntu Software Centre, it would default to the version that is usually very old (3.0.2 which was released during 2013). Since the world have changed a lot since then, you would like to remain up-to-date with the latest. The present version of R as of today is 3.2.3. Here are the series of commands that you need to issue:

Add PPA:
sudo add-apt-repository ppa:marutter/rrutter

Update…

17 thoughts on “Install R in Ubuntu and upgrade to latest version

  1. Hmm, I've tried this but it gives me a list of errors which all seem to revolve around the fact that 'Package r-base-core is not configured yet'. Starting R will work and it will mention being version 3.4.1; However I'm pretty convinced that once I really start using it I will run into some problems because quite a few packages couldn't be installed properly.
    I then tried removing R so I could reinstall the older version through ubuntu software centre, but I get the following errors. Any thoughts on how I might be able to fix this?

    installArchives() failed: (Reading database …
    (Reading database … 5%
    (Reading database … 10%
    (Reading database … 15%
    (Reading database … 20%
    (Reading database … 25%
    (Reading database … 30%
    (Reading database … 35%
    (Reading database … 40%
    (Reading database … 45%
    (Reading database … 50%
    (Reading database … 55%
    (Reading database … 60%
    (Reading database … 65%
    (Reading database … 70%
    (Reading database … 75%
    (Reading database … 80%
    (Reading database … 85%
    (Reading database … 90%
    (Reading database … 95%
    (Reading database … 100%
    (Reading database … 348418 files and directories currently installed.)
    Removing r-base (3.4.1-2trusty0) …
    Setting up r-base-core (3.4.1-2trusty0) …
    Preserving user changes to /usr/share/bash-completion/completions/R (renamed from /etc/bash_completion.d/R)…
    mv: cannot stat /usr/share/bash-completion/completions/R: No such file or directory
    dpkg: error processing package r-base-core (–configure):
    subprocess installed post-installation script returned error exit status 1
    dpkg: dependency problems prevent configuration of r-cran-boot:
    r-cran-boot depends on r-base-core (>= 3.4.1-2trusty0); however:
    Package r-base-core is not configured yet.
    r-cran-boot depends on r-api-3; however:
    Package r-api-3 is not installed.
    Package r-base-core which provides r-api-3 is not configured yet.

    dpkg: error processing package r-cran-boot (–configure):
    dependency problems – leaving unconfigured
    dpkg: dependency problems prevent configuration of r-cran-mass:
    r-cran-mass depends on r-base-core (>= 3.4.0-1trusty0); however:
    Package r-base-core is not configured yet.
    r-cran-mass depends on r-api-3; however:
    Package r-api-3 is not installed.
    Package r-base-core which provides r-api-3 is not configured yet.

    dpkg: error processing package r-cran-mass (–configure):
    dependency problems – leaving unconfigured
    dpkg: dependency problNo apport report written because the error message indicates its a followup error from a previous failure.
    No apport report written because the error message indicates its a followup error from a previous failure.
    No apport report written because MaxReports is reached already
    No apport report written because MaxReports is reached already
    No apport report written because MaxReports is reached already
    No apport report written because MaxReports is reached already
    No apport report written because MaxReports is reached already
    No apport report written because MaxReports is reached already
    No apport report written because MaxReports is reached already
    No apport report written because MaxReports is reached already
    No apport report written because MaxReports is reached already
    No apport report written because MaxReports is reached already
    No apport report written because MaxReports is reached already
    ems prevent configuration of r-cran-class:
    r-cran-class depends on r-base-core (>= 3.4.0-1trusty0); however:
    Package r-base-core is not configured yet.
    r-cran-class depends on r-api-3; however:
    Package r-api-3 is not installed.
    Package r-base-core which provides r-api-3 is not configured yet.
    r-cran-class depends on r-cran-mass; however:
    Package r-cran-mass is not configured yet.

    dpkg: error processing package r-cran-class (–configure):
    dependency problems – leaving unconfigured
    dpkg: dependency problems prevent configuration of r-cran-cluster:
    r-cran-cluster depends on r-base-core (>= 3.4.0-1trusty0); however:
    Package r-base-core is not configured yet.
    r-cran-cluster depends on r-api-3; however:
    Package r-api-3 is not installed.
    Package r-base-core which provides r-api-3 is not configured yet.

    dpkg: error processing package r-cran-cluster (–configure):
    dependency problems – leaving unconfigured
    dpkg: dependency problems prevent configuration of r-cran-codetools:
    No apport report written because MaxReports is reached already
    No apport report written because MaxReports is reached already
    No apport report written because MaxReports is reached already
    No apport report written because MaxReports is reached already
    r-cran-codetools depends on r-base-core; however:
    Package r-base-core is not configured yet.

    dpkg: error processing package r-cran-codetools (–configure):
    dependency problems – leaving unconfigured
    dpkg: dependency problems prevent configuration of r-cran-foreign:
    r-cran-foreign depends on r-base-core (>= 3.4.0-1trusty0); however:
    Package r-base-core is not configured yet.
    r-cran-foreign depends on r-api-3; however:
    Package r-api-3 is not installed.
    Package r-base-core which provides r-api-3 is not configured yet.

    dpkg: error processing package r-cran-foreign (–configure):
    dependency problems – leaving unconfigured
    dpkg: dependency problems prevent configuration of r-cran-kernsmooth:
    r-cran-kernsmooth depends on r-base-core (>= 3.4.0-1trusty0); however:
    Package r-base-core is not configured yet.
    r-cran-kernsmooth depends on r-api-3; however:
    Package r-api-3 is not installed.
    Package r-base-core which provides r-api-3 is not configured yet.
    r-cran-kernsmooth depends on r-cran-mass; however:
    Package r-cran-mass is not configured yet.

    dpkg: error processing package r-cran-kernsmooth (–configure):
    dependency problems – leaving unconfigured
    dpkg: dependency problems prevent configuration of r-cran-lattice:
    r-cran-lattice depends on r-base-core; however:
    Package r-base-core is not configured yet.

    dpkg: error processing package r-cran-lattice (–configure):
    dependency problems – leaving unconfigured
    dpkg: dependency problems prevent configuration of r-cran-matrix:
    r-cran-matrix depends on r-base-core (>= 3.4.1-2trusty0); however:
    Package r-base-core is not configured yet.
    r-cran-matrix depends on r-api-3; however:
    Package r-api-3 is not installed.
    Package r-base-core which provides r-api-3 is not configured yet.
    r-cran-matrix depends on r-cran-lattice (>= 0.12-11.1); however:
    Package r-cran-lattice is not configured yet.

    dpkg: error processing package r-cran-matrix (–configure):
    dependency problems – leaving unconfigured
    dpkg: dependency problems prevent configuration of r-cran-nlme:
    r-cran-nlme depends on r-base-core (>= 3.4.0-1trusty0); however:
    Package r-base-core is not configured yet.
    r-cran-nlme depends on r-api-3; however:
    Package r-api-3 is not installed.
    Package r-base-core which provides r-api-3 is not configured yet.
    r-cran-nlme depends on r-cran-lattice (>= 0.12-11.1); however:
    Package r-cran-lattice is not configured yet.

    dpkg: error processing package r-cran-nlme (–configure):
    dependency problems – leaving unconfigured
    dpkg: dependency problems prevent configuration of r-cran-mgcv:
    r-cran-mgcv depends on r-base-core (>= 3.4.1-2trusty0); however:
    Package r-base-core is not configured yet.
    r-cran-mgcv depends on r-api-3; however:
    Package r-api-3 is not installed.
    Package r-base-core which provides r-api-3 is not configured yet.
    r-cran-mgcv depends on r-cran-nlme; however:
    Package r-cran-nlme is not configured yet.
    r-cran-mgcv depends on r-cran-matrix; however:
    Package r-cran-matrix is not configured yet.

    dpkg: error processing package r-cran-mgcv (–configure):
    dependency problems – leaving unconfigured
    dpkg: dependency problems prevent configuration of r-cran-nnet:
    r-cran-nnet depends on r-base-core (>= 3.4.0-1trusty0); however:
    Package r-base-core is not configured yet.
    r-cran-nnet depends on r-api-3; however:
    Package r-api-3 is not installed.
    Package r-base-core which provides r-api-3 is not configured yet.

    dpkg: error processing package r-cran-nnet (–configure):
    dependency problems – leaving unconfigured
    dpkg: dependency problems prevent configuration of r-cran-survival:
    r-cran-survival depends on r-base-core (>= 3.4.0-1trusty0); however:
    Package r-base-core is not configured yet.
    r-cran-survival depends on r-api-3; however:
    Package r-api-3 is not installed.
    Package r-base-core which provides r-api-3 is not configured yet.
    r-cran-survival depends on r-cran-matrix; however:
    Package r-cran-matrix is not configured yet.

    dpkg: error processing package r-cran-survival (–configure):
    dependency problems – leaving unconfigured
    dpkg: dependency problems prevent configuration of r-cran-rpart:
    r-cran-rpart depends on r-base-core (>= 3.4.0-1trusty0); however:
    Package r-base-core is not configured yet.
    r-cran-rpart depends on r-api-3; however:
    Package r-api-3 is not installed.
    Package r-base-core which provides r-api-3 is not configured yet.
    r-cran-rpart depends on r-cran-survival; however:
    Package r-cran-survival is not configured yet.

    dpkg: error processing package r-cran-rpart (–configure):
    dependency problems – leaving unconfigured
    dpkg: dependency problems prevent configuration of r-cran-spatial:
    r-cran-spatial depends on r-base-core (>= 3.2.2-1trusty0); however:
    Package r-base-core is not configured yet.
    r-cran-spatial depends on r-api-3; however:
    Package r-api-3 is not installed.
    Package r-base-core which provides r-api-3 is not configured yet.

  2. Hi, I try all the steps but I found this troubling me while I tried to sudo apt-get update
    .

    Could you help me?

    E: Could not get lock /var/lib/dpkg/lock – open (11: Resource temporarily unavailable)
    E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

Leave a Comment

Your email address will not be published. Required fields are marked *