Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/algorithm/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux R3.0.2上的安装包(“devtools”)在Ubuntu 14.04中失败_Linux_R_Ubuntu - Fatal编程技术网

Linux R3.0.2上的安装包(“devtools”)在Ubuntu 14.04中失败

Linux R3.0.2上的安装包(“devtools”)在Ubuntu 14.04中失败,linux,r,ubuntu,Linux,R,Ubuntu,我正试图在Ubuntu 14.04上安装R3.0.2devtools软件包,如下所示: 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: de

我正试图在Ubuntu 14.04上安装R3.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构建时的稳定版本也包括在内。因此安装了R3.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的建议。

另一个解决方案(在版本R3.2.2上)是安装lxml:

$apt get安装libxml2 dev libxslt dev

已成功删除R错误:

错误:包“xml2”的配置失败

运行时出现在R中

安装包(“devtools”)


从安装R 3.2.0;一切都会安排妥当的。sudo将获得更新。。。然后sudo要安装r-base。。。将安装以下新软件包:r-base 0已升级、1新安装、0要删除和3未升级。需要获取0 B/9568 B的存档。执行此操作后,将使用73.7KB的额外磁盘空间。选择以前未选择的包r-base。(正在读取数据库…201581当前安装的文件和目录。)正在准备解压缩…/r-base_3.0.2-1ubuntu1_all.deb。。。拆包r型底座(3.0.2-1ubuntu1)。。。正在设置r-base(3.0.2-1ubuntu1)。。。jim@Ubuntu14:~$3.0.2仍在安装中。是否按照@DirkEddelbuettel发布的链接中的建议向/etc/apt/sources.list添加一个条目?谢谢您的解决方案!这对我有用。请将sources.list文件的位置编辑到/etc/apt/sources.list:)这里是可用的Ubuntu镜像:这里是服务器列表:。在我的例子中,这行代码起到了关键作用:deb vivid/libxml2 dev的
dependency还修复了基于Debian的Linuxes上
roxygen2
的潜在安装问题。