[R-sig-Debian] Change Rscript and `/usr/lib/R/bin/R` relation

Cron Acronis cronacronis at gmail.com
Wed Feb 10 16:50:13 CET 2016


Dear all,

I am trying to use multiple version of R unpacked from CRAN deb files.

It does work successfully, except for some packages installation, whether 
Rscript has been used. I have configured alternatives and switch R 
environments without any problem and can install most of the packages.

'======================================================
$ update-alternatives --display R
R - auto mode
  link currently points to /opt/R/3.2.3/usr/lib/R/bin/R
/opt/R/3.2.3/usr/lib/R/bin/R - priority 200
/usr/lib/R/bin/R - priority 100
Current 'best' version is '/opt/R/3.2.3/usr/lib/R/bin/R'.


$ update-alternatives --display Rscript
Rscript - auto mode
  link currently points to /opt/R/3.2.3/usr/lib/R/bin/Rscript
/opt/R/3.2.3/usr/lib/R/bin/Rscript - priority 200
/usr/lib/R/bin/Rscript - priority 100
Current 'best' version is '/opt/R/3.2.3/usr/lib/R/bin/Rscript'.
'======================================================

Rscript always invokes `/usr/lib/R/bin/R`, but my alternatives are 
configured against `/usr/bin/R`

'======================================================
$ Rscript --verbose -e 'Sys.getenv("R_HOME")'
running
  '/usr/lib/R/bin/R --slave --no-restore -e Sys.getenv("R_HOME")'

[1] "/usr/lib/R"
'======================================================

As have been mentioned by Dirk Eddelbuettel, in order to make Rscript 
invoke correct R, I can adjust `PATH` environment variable.

Which was done, but in my case didn't work out. Rscript still calls `/usr/
lib/R/bin/R`

'======================================================
$ env | grep PATH
PATH=/opt/R/3.2.3/usr/lib/R/bin:/opt/python/conda/bin::/usr/local/sbin:/
usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games


$ Rscript --version && Rscript --verbose -e 'print("Hello")'
    R scripting front-end version 3.2.3 (2015-12-10)
    running
      '/usr/lib/R/bin/R --slave --no-restore -e print("Hello")'

    [1] "Hello"
'======================================================


Could you please advise where I should dig further in order to force 
Rscript to use `/usr/bin/R` or `/opt/R/3.2.3/usr/lib/R/bin/R`?


Regards, Cron Acronis.



More information about the R-SIG-Debian mailing list