


However, there were a handful that I needed to install manually. update.packages(ask = FALSE)Īlmost all of my packages updated seamlessly using the above. That will take a while, depending on the number of packages you have installed. Start the R interpreter and then update all installed packages. sudo apt-get remove -y 'r-cran-*' Update Packages

It would make sense to get rid of these now and simply installed updated versions into your local library. While it might be the case that you wont have any issues with older versions, as packages are updated, you. You will probably have some packages that were previously installed with using APT. It is important to keep R and RStudio up-to-date. Sudo apt-get upgrade Remove System Packages # To update any R libraries installed via APT. # 18.04ĭeb trusty-cran35/ Update and Install sudo apt-get update sudo apt-key adv -keyserver -recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 APT SourcesĮdit /etc/apt/sources.list and add the line appropriate to your distribution of Ubuntu.

You may have already done this, in which case you can skip this step. To ensure the integrity of files, add the appropriate public key to your system. The complete instructions for doing the update on Ubuntu are available here. update.packages(ask FALSE) Almost all of my packages updated seamlessly using the above. Renviron file.Today I finally got around to updating my R to 3.5 (or, more specifically, 3.5.1). Start the R interpreter and then update all installed packages. The %v is automatically expanded to the major and minor version of R, so with R 3.5.1 this path becomes ~/R/library/3.5. You can also alternatively set R_LIBS_USER to a different path but make sure to include the %v wildcard. R_LIBS_USER is actually set by default to this scheme, (to ~/R/win-library/x.y on Windows and ~/Library/R/x.y/library on macOS) but the directory may not already exist, so one option is just to create this directory ( fs::dir_create(Sys.getenv("R_LIBS_USER"))). You also want to make sure the package library is specific to the minor version of R. This makes it easy to re-install R if needed without touching your CRAN packages. I suggest you keep the packages R comes with (base and recommended) packages separate from the rest of your packages. While it may work some (even most) of the time, R-core does not guarantee compatibility between these versions and things could break (even break silently). You may see some suggestions that you can just copy your packages even when the ‘minor’ version changes.
