在Linux Mint 17上運行R 3.1.2,當我嘗試安裝流行的軟件包時,出現non-zero exit status
。一個例子install.packages
嘗試的完整輸出如下:在Linux Mint上無法安裝R軟件包17
> install.packages("plyr")
Installing package into ‘/home/joe_kendrick/R/x86_64-pc-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/plyr_1.8.1.tar.gz'
Content type 'application/x-gzip' length 393233 bytes (384 Kb)
opened URL
==================================================
downloaded 384 Kb
* installing *source* package ‘plyr’ ...
** package ‘plyr’ successfully unpacked and MD5 sums checked
** libs
g++ -I/usr/share/R/include -DNDEBUG -I"/usr/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o
/bin/bash: g++: command not found
make: *** [RcppExports.o] Error 127
ERROR: compilation failed for package ‘plyr’
* removing ‘/home/joe_kendrick/R/x86_64-pc-linux-gnu-library/3.1/plyr’
The downloaded source packages are in
‘/tmp/RtmpXe52Mz/downloaded_packages’
Warning message:
In install.packages("plyr") :
installation of package ‘plyr’ had non-zero exit status
我得到本質上的其他包我嘗試安裝,如ggplot2
和vegan
,儘管在許多情況下,它是更冗長,因爲它試圖和相同的消息未能安裝依賴關係。
這似乎是一個有點常見的問題,但其他人似乎有outdatedsoftware或insufficientmemory。我正在運行Mint和R的最新穩定版本,並且我有大量的RAM和交換文件,所以我不認爲這些都會導致我的問題。
非常感謝將來的讀者,'sudo apt-get install r-base-dev'爲我打開了訣竅。 – Joe 2014-11-11 03:14:06
偉大的答案@DirkEddelbuettel! – Quantopik 2015-03-16 22:58:33