[英]install.packages(“devtools”) on R 3.0.2 fails in Ubuntu 14.04
我試圖在Ubuntu 14.04上安裝R 3.0.2 devtools
包,如下所示:
install.packages("devtools")
我得到以下結果:
Installing package into ‘/home/jim/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Warning: dependency ‘xml2’ is not available
also installing the dependency ‘rversions’
trying URL 'http://cran.rstudio.com/src/contrib/rversions_1.0.1.tar.gz'
Content type 'application/x-gzip' length 4624 bytes
opened URL
==================================================
downloaded 4624 bytes
trying URL 'http://cran.rstudio.com/src/contrib/devtools_1.8.0.tar.gz'
Content type 'application/x-gzip' length 141487 bytes (138 Kb)
opened URL
==================================================
downloaded 138 Kb
ERROR: dependency ‘xml2’ is not available for package ‘rversions’
* removing ‘/home/jim/R/x86_64-pc-linux-gnu-library/3.0/rversions’
ERROR: dependency ‘rversions’ is not available for package ‘devtools’
* removing ‘/home/jim/R/x86_64-pc-linux-gnu-library/3.0/devtools’
The downloaded source packages are in
‘/tmp/RtmpmDzsRJ/downloaded_packages’
Warning messages:
1: In install.packages("devtools") :
installation of package ‘rversions’ had non-zero exit status
2: In install.packages("devtools") :
installation of package ‘devtools’ had non-zero exit status
似乎存在對名為xml2
的包的依賴性。 有誰知道我在哪里可以找到這個包以及如何安裝它。
我已經安裝了以下內容:
sudo apt-get install libxml2-dev
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libcurl4-gnutls-dev
sudo apt-get install curl
如果使用軟件中心在Ubuntu中安裝R,則包含構建Ubuntu構建時的穩定版本。 因此安裝了R 3.0.2。
將以下內容添加到/etc/apt/sources.list:
deb http://cran.rstudio.com/bin/linux/ubuntu trusty/
導致當前版本(R 3.2.0)被加載。
我必須安裝以下OpenSSL庫
sudo apt-get install libssl-dev
然后我就能啟動R並成功安裝'devtools'
非常感謝Dirk和Pascal的建議。
另一個解決方案(在版本R 3.2.2上)是安裝lxml:
$ apt-get install libxml2-dev libxslt-dev
哪個成功刪除了R錯誤:
錯誤:包'xml2'的配置失敗
跑步時出現在R中
install.packages(注明 “DevTools”)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.