Updating R the easy way: using rig command line tool

TIL
R
Author

Thomas Sandmann

Published

December 11, 2022

Today it was time to update the R installation on my Mac OS X system, from R 4.2.1 to 4.2.2. Luckily, with Gábor Csárdi’s rig command line tool that was a breeze.

I had previously installed rig with brew

brew tap r-lib/rig
brew install --cask rig

so I first checked if there were any updates available for rig itself:

brew upgrade --cask rig

This command updated rig from version 0.5.0 to 0.5.2.

Then I listed the R versions currently installed on my system:

rig list
  4.1   (R 4.1.3)
* 4.2   (R 4.2.1)

At this point, I was using R release 4.2.1. Next, I updated to the latest release

rig install

[INFO] Downloading https://cloud.r-project.org/bin/macosx/base/R-4.2.2.pkg -> /tmp/rig/x86_64-R-4.2.2.pkg
[INFO] Running installer
[INFO] > installer: Package name is R 4.2.2 for macOS
[INFO] > installer: Installing at base path /
[INFO] > installer: The install was successful.
[INFO] Forgetting installed versions
[INFO] Fixing permissions
[INFO] Adding R-* quick links (if needed)
[INFO] Setting default CRAN mirror
[INFO] Installing pak for R 4.2 (if not installed yet)

Once the rig install command had completed, my system had updated itself to R version 4.2.2:

rig list
  4.1   (R 4.1.3)
* 4.2   (R 4.2.2)

Now a new R session starts with R 4.2.2

>R

R version 4.2.2 (2022-10-31) -- "Innocent and Trusting"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin17.0 (64-bit)

Thank you, Gábor!

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.