Skip to content

Updating R on Linux

Louis Maddox edited this page Jun 9, 2016 · 16 revisions

NB - if on Windows, use Tal Galili's installr (upgrade R from within R!)


  • sudo vim /etc/apt/sources.list
  • Add deb https://mirrors.ebi.ac.uk/CRAN/bin/linux/ubuntu trusty/
    • deb MIRROR_URL/bin/linux/ubuntu LINUX_CODENAME/
      MIRROR_URL : https://mirrors.ebi.ac.uk/CRAN/ — via list of mirrors here
      LINUX_CODENAME : trusty — via cat /etc/*-release
  • sudo apt-get update

Problem: GPG key has expired (R's Secure APT)

Solution: add new key given here

  • Via notes at CRAN on Secure APT via this ServerFault question
  • run sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys GPG_KEY
    GPG_KEY : currently E084DAB9 (June 2016, apparently changed mid-Oct '15)
    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9

  • sudo apt-get install r-base

Users who need to compile R packages from source [e.g. package maintainers, or anyone installing packages with install.packages()] should also install the r-base-dev package:

sudo apt-get install r-base-dev


* (Followed the system hint to run `sudo apt-get update` again after this step)

```sh
~ $ R

R version 3.3.0 (2016-05-03) -- "Supposedly Educational"

Upgrade complete 😎

Clone this wiki locally