2015-09-06 212 views
1

我試圖更新codetools軟件包並得到相同的錯誤是我使用update.package()或install.package(),如下所示。任何有識之士的讚賞:安裝r軟件包代碼工具時出錯

R> install.packages("codetools", lib = "/usr/lib/R/library") 
trying URL 'https://cran.rstudio.com/src/contrib/codetools_0.2-14.tar.gz' 
Content type 'application/x-gzip' length 12938 bytes (12 KB) 
================================================== 
downloaded 12 KB 

* installing *source* package ‘codetools’ ... 
** package ‘codetools’ successfully unpacked and MD5 sums checked 
mv: cannot move ‘/usr/lib/R/library/codetools’ to ‘/usr/lib/R/library/00LOCK-codetools/codetools’: Permission denied 
Warning in file.copy(f, instdir, TRUE) : problem copying ./NAMESPACE to /usr/lib/R/library/codetools/NAMESPACE: Permission denied 
Warning in file(file, ifelse(append, "a", "w")) : cannot open file '/usr/lib/R/library/codetools/DESCRIPTION': Permission denied 
Error in file(file, ifelse(append, "a", "w")) : cannot open the connection 
ERROR: installing package DESCRIPTION failed for package ‘codetools’ 
* removing ‘/usr/lib/R/library/codetools’ 
Warning in install.packages : installation of package ‘codetools’ had non-zero exit status 

The downloaded source packages are in 
‘/tmp/RtmpiJWb8L/downloaded_packages’ 
Updating HTML index of packages in '.Library' 
Warning in install.packages : cannot create file '/usr/share/R/doc/html/packages.html', reason 'Permission denied' 
Warning in install.packages : cannot update HTML package index 
+0

這裏是我的建議:如果您有權限,請刪除'/ usr/lib/R/library/00LOCK-codetools /'文件夾,然後重新打開。 – RHertel

回答

4

權限被拒絕聽起來像是你沒有該系統的管理員權限。嘗試以root身份運行R(或使用sudo),然後查看它是否有效。