Updating R on Ubuntu

July 8, 2018
By

(This article was first published on R on datawookie, and kindly contributed to R-bloggers)

Today I finally got around to updating my R to 3.5 (or, more specifically, 3.5.1). The complete instructions for doing the update on Ubuntu are available here. I’ve paraphrased them below.

Authentication Key

To ensure the integrity of files, add the appropriate public key to your system. You may have already done this, in which case you can skip this step.

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9

APT Sources

Edit /etc/apt/sources.list and add the line appropriate to your distribution of Ubuntu.

# 18.04
deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/
# 16.04
deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/
# 14.04
deb https://cloud.r-project.org/bin/linux/ubuntu trusty-cran35/

Update and Install

sudo apt-get update
sudo apt-get install r-base r-base-dev
#
# To update any R libraries installed via APT.
#
sudo apt-get upgrade

Remove System Packages

You will probably have some packages that were previously installed with using APT. It would make sense to get rid of these now and simply installed updated versions into your local library.

sudo apt-get remove -y 'r-cran-*'

Update Packages

Start the R interpreter and then update all installed packages. That will take a while, depending on the number of packages you have installed.

update.packages(ask = FALSE)

Almost all of my packages updated seamlessly using the above. However, there were a handful that I needed to install manually.

To leave a comment for the author, please follow the link and comment on their blog: R on datawookie.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers

Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)