我在Ubuntu服务器(14)上安装了R和Rstudio,当我尝试安装软件包时,我收到了这些错误:
>install.packages("nnet")
Installing package into ‘/home/zhge/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
--2015-09-08 02:43:31-- https://cran.rstudio.com/src/contrib/nnet_7.3-11.tar.gz Resolving
cran.rstudio.com (cran.rstudio.com)... 54.230.140.42 Connecting to
cran.rstudio.com (cran.rstudio.com)|54.230.140.42|:443... connected.
HTTP request sent, awaiting response... 200 OK Length: 28455 (28K)
[application/x-gzip] Saving to:
‘/tmp/RtmpBT7yHE/downloaded_packages/nnet_7.3-11.tar.gz’
0K .......... .......... ....... 100% 1.20M=0.02s
2015-09-08 02:43:31 (1.20 MB/s) -
‘/tmp/RtmpBT7yHE/downloaded_packages/nnet_7.3-11.tar.gz’ saved
[28455/28455]
/usr/lib/R/bin/R: line 140: /usr/lib/R/etc/ldpaths: Permission denied
/usr/lib/R/bin/R: line 236: /usr/lib/R/etc/ldpaths: Permission denied
Error in file(con, "r") : cannot open the connection Calls:
<Anonymous> -> sub -> grep -> readLines -> file In addition: Warning
message: In file(con, "r") : cannot open file
'/usr/lib/R/etc/Makeconf': Permission denied Warning in
install.packages : installation of package ‘nnet’ had non-zero exit
status
The downloaded source packages are in
‘/tmp/RtmpBT7yHE/downloaded_packages’
更新: 这只是许可问题,我只需要:
$ sudo chmod -R 0777 /usr/lib/R/etc/ldpaths
和其他目录:/ usr / lib / R / etc / Makeconf和/ usr / lib / R / bin /。我之前从未遇到过这个问题,所以它并没有立即成为我的问题。