首先,我对 Linux 还很陌生。我在 Linux 服务器(Ubuntu 12.10、Quantal Quetzal)上安装了 R 3.1.1(最新版本),并尝试在 R 中安装 devtools 包。当我运行install.packages("devtools")
命令,我收到以下错误:
Cannot find curl-config
ERROR: configuration failed for package ‘RCurl’
...
Warning messages:
1: In install.packages("devtools", dependencies = TRUE) :
installation of package ‘RCurl’ had non-zero exit status
2: In install.packages("devtools", dependencies = TRUE) :
installation of package ‘httr’ had non-zero exit status
3: In install.packages("devtools", dependencies = TRUE) :
installation of package ‘devtools’ had non-zero exit status
我尝试了其他相关 StackOverflow 答案中的所有命令(请参阅帖子底部),但没有一个起作用。例如,如果我输入sudo apt-get install libcurl4-openssl-dev
,我收到以下错误:
Err http://security.ubuntu.com/ubuntu/ quantal-security/main libssl-doc all 1.0.1c-3ubuntu2.5
404 Not Found [IP: 91.189.92.201 80]
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.0.0_1.0.1c-3ubuntu2.5_amd64.deb 404 Not Found [IP: 91.189.92.201 80]
...
Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
我尝试过跑步apt-get update
但这也不允许我安装 libcurl 。
这是我的sources.list 文件:
deb http://archive.ubuntu.com/ubuntu quantal main
deb http://archive.ubuntu.com/ubuntu quantal-updates main
deb http://security.ubuntu.com/ubuntu quantal-security main
deb http://archive.ubuntu.com/ubuntu quantal universe
deb http://archive.ubuntu.com/ubuntu quantal-updates universe
deb http://cran.rstudio.com/bin/linux/ubuntu quantal/
deb-src http://cran.rstudio.com/bin/linux/ubuntu quantal/
deb http://cran.rstudio.com/bin/linux/ubuntu raring/
deb-src http://cran.rstudio.com/bin/linux/ubuntu raring/
我尝试将sources.list中的“archive”更改为“old-releases”,但找不到任何libcurl库:libcurl4-openssl-dev、libcurl4-nss-dev或libcurl4-gnutls-dev。
我也尝试安装 Curl 7.37.1从源头 http://curl.haxx.se/download.html,并且安装正确。这样做允许我安装 RCurl 包,但是当我尝试在 R 中使用 install_github() 函数时收到错误:install_github('rCharts', 'ramnathv')
:
Error in function (type, msg, asError = TRUE) : Protocol https not supported or disabled in libcurl
我不确定这是否是 libcurl、RCurl、devtools 或我的旧 Linux 发行版的问题。不知道从这里去哪里。以下是我咨询过的相关问题:
安装 devtools 包时出现问题 https://stackoverflow.com/questions/20923209/problems-installing-the-devtools-package
“非零退出状态”R 3.0.1“XML”和“RCurl” https://stackoverflow.com/questions/20671814/non-zero-exit-status-r-3-0-1-xml-and-rcurl
无法为 Linux Redhat 服务器上安装的 R studio 安装 Devtools 包 https://stackoverflow.com/questions/20236726/unable-to-install-devtools-package-for-r-studio-mounted-on-linux-redhat-server