[R-SIG-Mac] Permission denied error while updating R packages

David Winsemius dwinsemius at comcast.net
Tue Mar 8 19:37:34 CET 2016


> On Feb 23, 2016, at 11:11 AM, Iryna Nikolayeva <iryna.v.nikolayeva at gmail.com> wrote:
> 
> Dear R-Sog-Mac members, 
> 
> I have an issue while automatically updating packages in R. 
> For the packages installed in my second library, while automatically updating I get the following "Permission denied” messages(details below). 
> I suppose I know where this problem comes from: 
> I had installed a few different versions of R. 
> And now I have 2 library paths: 
>> .libPaths() 
> [1] "/Users/iryna/Library/R/3.1/library"                                       
> [2] "/opt/local/Library/Frameworks/R.framework/Versions/3.1/Resources/library” 

This is just a guess, ... did you install that version of R through MacPorts? The most recent version of OSX has nailed down a lot of system folders to which write access used to be available.
> 
> And for some reason R just doesn’t have rights to update packages in my second library. 
> Do you know why is that? How should I fix this issue? 
> 
> 
> 
> Here is the error message: 
> 
> * installing *source* package ‘mgcv’ ... 
> ** package ‘mgcv’ successfully unpacked and MD5 sums checked 
> mv: rename /opt/local/Library/Frameworks/R.framework/Versions/3.1/Resources/library/mgcv to /opt/local/Library/Frameworks/R.framework/Versions/3.1/Resources/library/00LOCK-mgcv/mgcv: Permission denied 
> Warning in file.copy(f, instdir, TRUE) : 
>  problem copying ./NAMESPACE to /opt/local/Library/Frameworks/R.framework/Versions/3.1/Resources/library/mgcv/NAMESPACE: Permission denied 
> Warning in file(file, ifelse(append, "a", "w")) : 
>  cannot open file '/opt/local/Library/Frameworks/R.framework/Versions/3.1/Resources/library/mgcv/DESCRIPTION': Permission denied 
> Error in file(file, ifelse(append, "a", "w")) : 
>  cannot open the connection 
> ERROR: installing package DESCRIPTION failed for package ‘mgcv’ 
> * removing ‘/opt/local/Library/Frameworks/R.framework/Versions/3.1/Resources/library/mgcv’ 
> 
> 
> Here are some additional information on my settings: 
>> version 
> platform       x86_64-apple-darwin13.4.0   
> arch           x86_64                      
> os             darwin13.4.0                
> system         x86_64, darwin13.4.0        
> status                                     
> major          3                           
> minor          1.2                         
> year           2014                        
> month          10                          
> day            31                          
> svn rev        66913                       
> language       R                           
> version.string R version 3.1.2 (2014-10-31)

You should use the binary installer package to update to the current version of R. Then your .libPaths() result should be:

[1] "/Library/Frameworks/R.framework/Versions/3.2/Resources/library"

You can then add  "/Users/iryna/Library/R/3.2/library" with:

 .libPaths(c("/Users/iryna/Library/R/3.2/library", .libPaths() ) ) 

, then copy old packages from your libraries, 
 and run (from the R console):  update.packages(checkBuilt=TRUE)


> 
> nickname       Pumpkin Helmet                              
> 
> Thanks in advance for your help, 
> Iryna Nikolayeva 
> 

> 	[[alternative HTML version deleted]]

Please post in plain text.

> 
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

David Winsemius
Alameda, CA, USA



More information about the R-SIG-Mac mailing list