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.
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 E298A3A825C0D65DFD57CBB651716619E084DAB9
/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-*'
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.