Bug 742670 - R CMD INSTALL doesn't work without admin privileges
Summary: R CMD INSTALL doesn't work without admin privileges
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: R
Version: 14
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tom "spot" Callaway
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-01 07:29 UTC by Pierre-YvesChibon
Modified: 2011-10-01 07:54 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-10-01 07:54:02 UTC
Type: ---


Attachments (Terms of Use)

Description Pierre-YvesChibon 2011-10-01 07:29:50 UTC
Description of problem:
Usually R CMD INSTALL should install a package in ~/R/... if run without admin rights.
Current version tries to install on /usr/lib(64)/R/...

Version-Release number of selected component (if applicable):
$ rpm -q R
R-2.13.1-4.fc14.x86_64


How reproducible:
Always

Steps to Reproduce:
1. wget http://bioconductor.org/packages/2.8/bioc/src/contrib/a4_1.1.2.tar.gz
2. R CMD INSTALL a4_1.1.2.tar.gz
  
Actual results:
$ R CMD INSTALL Download/a4_1.1.2.tar.gz 
* installing to library ‘/usr/lib64/R/library’
Error: ERROR: no permission to install to directory ‘/usr/lib64/R/library’

Expected results:
Install a4 in the home directory.

Additional info:

Comment 1 Tom "spot" Callaway 2011-10-01 07:54:02 UTC
R CMD INSTALL, by default, installs packages in the library tree rooted at the first directory in .libPaths() for an R session run in the current environment

.libPaths is used for getting or setting the library trees that R knows about (and hence uses when looking for packages). 

The library search path is initialized at startup from the environment variable R_LIBS (which should be a colon-separated list of directories at which R library trees are rooted) followed by those in environment variable R_LIBS_USER. Only directories which exist at the time will be included.

By default R_LIBS is unset, and R_LIBS_USER is set to directory ‘R/R.version$platform-library/x.y’ of the home directory, for R x.y.z. 

Or, to put it succinctly, R CMD INSTALL doesn't see the ~/R/x86_64-redhat-linux-gnu-library/2.13/ directory (because it doesn't exist). If you create it, it should show up in the .libPaths() and R CMD INSTALL should prefer it.

Before:
> .libPaths()
[1] "/usr/lib64/R/library" "/usr/share/R/library"
> 

Create Directory:
[spot@pterodactyl ~]$ mkdir -p ~/R/x86_64-redhat-linux-gnu-library/2.13/

After:
> .libPaths()
[1] "/home/spot/R/x86_64-redhat-linux-gnu-library/2.13"
[2] "/usr/lib64/R/library"                             
[3] "/usr/share/R/library"


Note You need to log in before you can comment on or make changes to this bug.