R 3.0.2上的install.packages(“devtools”)在Ubuntu 14.04中失败

时间:2021-10-06 14:06:53

I am trying to install the R 3.0.2 devtools package on Ubuntu 14.04 as follows:

我试图在Ubuntu 14.04上安装R 3.0.2 devtools包,如下所示:

install.packages("devtools")

I get the following results:

我得到以下结果:

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

It appears there is a dependency on a package named xml2. Does anyone know where I can find this package and how I can install it.

似乎存在对名为xml2的包的依赖性。有谁知道我在哪里可以找到这个包以及如何安装它。

I have already installed the following:

我已经安装了以下内容:

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

2 个解决方案

#1


24  

If R is installed in Ubuntu using the software center, the stable version at the time of the Ubuntu build is built is included. Hence R 3.0.2 is installed.

如果使用软件中心在Ubuntu中安装R,则包含构建Ubuntu构建时的稳定版本。因此安装了R 3.0.2。

Adding the following to /etc/apt/sources.list:

将以下内容添加到/etc/apt/sources.list:

deb http://cran.rstudio.com/bin/linux/ubuntu trusty/

resulted in the current version (R 3.2.0) being loaded.

导致当前版本(R 3.2.0)被加载。

I had to install the following OpenSSL library

我不得不安装以下OpenSSL库

sudo apt-get install libssl-dev

and then I was able to start R and successfully install 'devtools'

然后我就能启动R并成功安装'devtools'

Many thanks to Dirk and Pascal for their advice.

非常感谢Dirk和Pascal的建议。

#2


7  

Another solution (on version R 3.2.2) is to installing lxml:

另一个解决方案(在版本R 3.2.2上)是安装lxml:

$ apt-get install libxml2-dev libxslt-dev

$ apt-get install libxml2-dev libxslt-dev

which successfully removed the R error:

哪个成功删除了R错误:

Error: configuration failed for package ‘xml2’

错误:包'xml2'的配置失败

appearing in R when running

跑步时出现在R中

install.packages("devtools")

install.packages(注明 “DevTools”)

#1


24  

If R is installed in Ubuntu using the software center, the stable version at the time of the Ubuntu build is built is included. Hence R 3.0.2 is installed.

如果使用软件中心在Ubuntu中安装R,则包含构建Ubuntu构建时的稳定版本。因此安装了R 3.0.2。

Adding the following to /etc/apt/sources.list:

将以下内容添加到/etc/apt/sources.list:

deb http://cran.rstudio.com/bin/linux/ubuntu trusty/

resulted in the current version (R 3.2.0) being loaded.

导致当前版本(R 3.2.0)被加载。

I had to install the following OpenSSL library

我不得不安装以下OpenSSL库

sudo apt-get install libssl-dev

and then I was able to start R and successfully install 'devtools'

然后我就能启动R并成功安装'devtools'

Many thanks to Dirk and Pascal for their advice.

非常感谢Dirk和Pascal的建议。

#2


7  

Another solution (on version R 3.2.2) is to installing lxml:

另一个解决方案(在版本R 3.2.2上)是安装lxml:

$ apt-get install libxml2-dev libxslt-dev

$ apt-get install libxml2-dev libxslt-dev

which successfully removed the R error:

哪个成功删除了R错误:

Error: configuration failed for package ‘xml2’

错误:包'xml2'的配置失败

appearing in R when running

跑步时出现在R中

install.packages("devtools")

install.packages(注明 “DevTools”)