On my Ubuntu server my default R version is 4.0.3.
I've installed R version 4.0.5 so i can then logon as root and install the rgdal package so that the libraries will be available to all users automatically.
My issue is that i do not know how to switch r version from 4.0.3 to 4.0.5 at Ubuntu terminal.
Is there an easy way to do this please?
The docs you've mentioned, seem to point to changing the default R version for use in Rstudio\Posit workbench (as far as i can tell).
I do not want to do that.
i want to change the R version at the Ubuntu Server terminal.
For eg, right now i logon to the server, change to the 'root' account and the type 'R' which gives me the R prompt and tells me i'm using version 4.0.3
How did you install the different versions of R? Personally I find it easiest to use GitHub - r-lib/rig: The R Installation Manager, which allows for transparent installation of multiple version of R including selecting the default to use.
If you want to roll your own: The version of R available in the terminal depends on the value of the PATH environment variable. It determines the order in which different directories are being searched for any binary to run.
I already have multiple versions installed as shown in previous screenshot.
I simply want to load R version 4.0.5 from Ubuntu terminal so I can install packages as a root user.