2014-11-07 9 views
2

Linux Mint 17에서 R 3.1.2를 실행하면 인기있는 패키지를 설치하려고 할 때 non-zero exit status이 표시됩니다.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 

나는 기본적으로 내가 설치하려고 다른 패키지, 많은 경우에 더 장황하지만 예를 들어 ggplot2vegan, 그것은 시도하고에 대해 동일한 메시지를 얻을 다음과 같이 예를 들어 install.packages 시도의 전체 출력은 종속성을 설치하지 못합니다.

다소 일반적인 문제인 것처럼 보이지만 다른 사람은 outdatedsoftware 또는 insufficientmemory 중 하나 인 것 같습니다. 민트와 R의 최신 안정 버전을 실행 중이며 충분한 RAM과 스왑 파일이 있으므로이 중 하나라도 내 문제를 일으키는 것으로 생각하지 않습니다. 오류 메시지가 나타난다 C++ 컴파일러를 설치해야

/bin/bash: g++: command not found 

답변

9

. 나는이 중 하나를 시작할 것 :

sudo apt-get install build-essentials  # key tools 

또는

sudo apt-get install r-base-dev    # many development tools for R 

또는 물론

sudo apt-get install r-cran-rcpp    # to not install from source 

비록 Rcpp 당신이 당신이 필요로하는 것보다 나이가있을 수 있습니다 얻을.

데비안 기반 시스템 사용자를위한 목록이 r-sig-debian입니다.

+2

장래의 잠재적 인 독자들에게 감사드립니다.'sudo apt-get install r-base-dev'는 나에게 트릭을 만들어주었습니다. – Joe

+1

위대한 답변 @DirkEddelbuettel! – Quantopik

0

제 경우에는 Mint 18을 새로 설치하고 특정 패키지가 누락되었습니다. R의 오류 메시지마다 "readr"을 설치하려고 시도했지만 "libcurl4-openssl-dev"라는 기본 패키지가 없어서 설치하지 않습니다. 필자는 오류없이 설치 한 후 readr를 설치하고 RStudio 용 패키지를 예상대로로드합니다.

관련 문제