R 3.5.0 installation packages for Ubuntu Xenial (16.04) do not yet exist on the ubuntu mirror sites. Is there an alternative method for updating R to 3.5.0 on ubuntu xenial? Alternatively, is there a different method to update R to 3.5.0?

  • 1
    Have you had a look at this walkthrough? The author doesn't explicitly say it anywhere, but these are directions for installing 3.5 – Emily May 3 at 15:52
  • Try here: askubuntu.com/questions/862403/… – valiano May 3 at 17:55
  • @Emily: The walkthrough you linked to is about installing R from source. – krlmlr Jun 2 at 9:37
  • @valiano: This answers a different question. – krlmlr Jun 2 at 9:37

R 3.5 are currently only available from a PPA, because some of CRAN's packages have problems building with R 3.5.

Proceed at your own risk.

The procedure that worked for me is:

  1. Remove all r-cran-* packages from your system (YMMV, I'm usually installing packages from source and have very few of these)

    • Search with dpkg -l | grep r-cran-
  2. Add Michael Rutter's PPA:

    sudo add-apt-repository ppa:marutter/rrutter3.5
    sudo apt-get update
    
  3. Upgrade R

    sudo apt install r-api-3.5
    
  4. Install all packages you need from source (to a personal or site library via install.packages()) or by installing the corresponding r-cran-* Ubuntu package.

    I use the following script to reinstall all packages my packages from my personal site library for R 3.4:

    installed <- rownames(installed.packages())
    pkgs <- dir("~/R/x86_64-pc-linux-gnu-library/3.4")
    new <- setdiff(pkgs, installed)
    new
    install.packages(new)
    

    If you have a machine with multiple CPUs, you can speed up the process, for example:

    install.packages(new, Ncpus = 6)
    

References

  • 1
    The method above worked entirely correctly for me. (Thanks to Krlmlr.) Two additional suggestions for those not experienced with Ubuntu: 1. Remove prior r-cran-* packages with: sudo apt-get remove r-cran-* 2. After adding Michael Rutter's PPA, remember to run: sudo apt-get update – Larry Jun 8 at 1:36
  • The method above worked entirely correctly for me. (Thanks to Krlmlr.) Two additional suggestions for those not experienced with Ubuntu: 1. Remove prior r-cran-* packages with: sudo apt-get remove r-cran-* 2. After adding Michael Rutter's PPA, remember to run: sudo apt-get update before running: sudo apt install r-api-3.5 – Larry Jun 8 at 1:42
  • @Larry: Thanks. Can you edit the post? – krlmlr Jun 8 at 11:10
  • @krlmlr I suggest that you remove Ncpus = 6 from the answer. It might lead to unexpected slow-downs, specially for people that (i) don't read the code fully before copy/paste; and (ii) will do this in a personal computer. The option is also not required for the answer. – fridaymeetssunday Jun 29 at 7:20
  • 1
    @fridaymeetssunday: Added comment. Agree that Ncpus = 6 may be slow on weak machines, but then nobody should copy-paste without at least scanning the code. – krlmlr Jun 29 at 8:02

The CRAN site has been updated since's @krlmlr's response in early June: https://cran.r-project.org/bin/linux/ubuntu/.

The CRAN instructions have several steps, but the summary is that the sources.list file should reference a repository that's specific to version 3.5. The entry is something like

deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/

instead of the previous (versionless) entry of

deb https://cloud.r-project.org/bin/linux/ubuntu xenial/

The relevant description from the website (which will eventually change):

As of June 11, 2018 the supported releases are Xenial Xerus (16.04; LTS), Trusty Tahr (14.04; LTS), and Bionic Beaver (18.04;LTS). Note, to install R 3.5 packages, a different sources.list entry is needed. See below for details.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.