R 3.0.2上的install.packages("devtools")在Ubuntu 14.04中失败 [英] install.packages("devtools") on R 3.0.2 fails in Ubuntu 14.04

查看:417
本文介绍了R 3.0.2上的install.packages("devtools")在Ubuntu 14.04中失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Ubuntu 14.04上安装R 3.0.2 devtools软件包,如下所示:

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

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的程序包.有人知道我在哪里可以找到此软件包以及如何安装它.

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.

我已经安装了以下内容:

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

推荐答案

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

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.

在/etc/apt/sources.list中添加以下内容:

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

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

导致当前版本(R 3.2.0)正在加载.

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

我必须安装以下OpenSSL库

I had to install the following OpenSSL library

sudo apt-get install libssl-dev

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

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

非常感谢Dirk和Pascal的建议.

Many thanks to Dirk and Pascal for their advice.

这篇关于R 3.0.2上的install.packages("devtools")在Ubuntu 14.04中失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆