简体   繁体   English

在 Ubuntu 上安装包“devtools”的退出状态为非零

[英]installation of package ‘devtools’ had non-zero exit status on Ubuntu

I'm trying to install devtools in a PowerPC with a R version 3.1.1 but failed at the end because the curl library:我正在尝试在 R 版本 3.1.1 的 PowerPC 中安装 devtools,但最终失败了,因为 curl 库:

...
** testing if installed package can be loaded Error in dyn.load(file, DLLpath = DLLpath, ...) :    unable to load shared object '/path
to/R/powerpc-unknown-linux-gnu-library/3.1/curl/libs/curl.so':   /path
to/R/powerpc-unknown-linux-gnu-library/3.1/curl/libs/curl.so:
undefined symbol: BSWAP_32 Error: loading failed Execution halted
ERROR: loading failed
 * removing ‘/path to/R/powerpc-unknown-linux-gnu-library/3.1/curl’ ERROR: dependency ‘curl’ is not available for package ‘httr’
 * removing ‘/path to/R/powerpc-unknown-linux-gnu-library/3.1/httr’ ERROR: dependency ‘curl’ is not available for package ‘rversions’
 * removing ‘/path to/R/powerpc-unknown-linux-gnu-library/3.1/rversions’ ERROR:
dependencies ‘httr’, ‘rversions’ are not available for package
‘devtools’
* removing ‘/path to/R/powerpc-unknown-linux-gnu-library/3.1/devtools’

The downloaded source packages are in
 ‘/tmp/RtmpD0yE63/downloaded_packages’ Warning messages: 1: In
install.packages("devtools") :   installation of package ‘curl’ had
non-zero exit status 2: In install.packages("devtools") :  
installation of package ‘httr’ had non-zero exit status 3: In
install.packages("devtools") :   installation of package ‘rversions’
had non-zero exit status 4: In install.packages("devtools") :  
installation of package ‘devtools’ had non-zero exit status

I've already installed libcurl4-gnutls-dev and libcurl4-openssl-dev and the libcurl version is 7.38.0.我已经安装了 libcurl4-gnutls-dev 和 libcurl4-openssl-dev 并且 libcurl 版本是 7.38.0。

Does anyone know a fix to this?有谁知道解决这个问题? Thanks ;)谢谢 ;)

The same problem happened to me when I was trying to install "devtools" package on a new machine with Ubuntu 16.04 system.当我尝试在带有 Ubuntu 16.04 系统的新机器上安装“devtools”包时,同样的问题发生在我身上。

I tried many answers including the adopted one above, but I still couldn't solve the problem until I noticed another warning information "(as 'lib' is unspecified)".我尝试了很多答案,包括上面采用的答案,但直到我注意到另一个警告信息“(因为 'lib' 未指定)”,我仍然无法解决问题。 Then I realized that I was running R as a normal user while the R base is installed by root.然后我意识到我是作为普通用户运行 R 而 R 基础是由 root 安装的。 It means the package "devtools" couldn't be installed into the default R library folder and possibly couldn't use some dependent packages.这意味着包“devtools”无法安装到默认的 R 库文件夹中,并且可能无法使用某些依赖包。 Then the solution became very easy: run R as root user and then install "devtools".然后解决方案变得非常简单:以root用户身份运行R,然后安装“devtools”。

Following the instructions of Dean Attali ( https://www.digitalocean.com/community/tutorials/how-to-set-up-r-on-ubuntu-14-04 ), I summarize the steps below.按照 Dean Attali ( https://www.digitalocean.com/community/tutorials/how-to-set-up-r-on-ubuntu-14-04 ) 的说明,我总结了以下步骤。 Just run them in a terminal.只需在终端中运行它们。

$ sudo apt-get -y install libcurl4-gnutls-dev libxml2-dev libssl-dev
$ sudo su  
$ R
> install.packages('devtools', repos='http://cran.rstudio.com/')

That's it.就是这样。 Since the package is installed by root, it can be used by all users of the system.由于该软件包是由 root 安装的,因此系统的所有用户都可以使用它。

For Curl use:对于卷曲使用:

apt-get -y build-dep libcurl4-gnutls-dev
apt-get -y install libcurl4-gnutls-dev

And you should update the R version to R-3.1.2您应该将 R 版本更新为 R-3.1.2

wget http://cran.r-project.org/src/base/R-3/R-3.1.2.tar.gz

I m using Ubuntu 16.04 and this is how I solved this issue:我使用的是 Ubuntu 16.04,这就是我解决这个问题的方法:

aptitude install libssl-dev

then aptitude packg manage will allow you to choose the right version which is required for installation of devtools.然后 aptitude packg manage 将允许您选择安装 devtools 所需的正确版本。 Repeat the same for重复相同的

aptitude libcurl4-gnutls-dev
aptitude libxml2-dev

Finally, install this libgit2 lib最后,安装这个 libgit2 库

devtools::install_github('ropensci/git2r')
devtools::load_all()
R CMD INSTALL git2r

I could not solve it with apt-get packg manager.我无法使用 apt-get packg manager 解决它。 Thats all :) !就这样 :) !

This error was happening when I was using 3.0.2.当我使用 3.0.2 时发生了这个错误。 I updated the R, now It is fine.我更新了 R,现在很好。 I also spent the one day to find the solution.我也花了一天时间来寻找解决方案。 I tried the all the solution.我尝试了所有的解决方案。 But, no effect.但是,没有效果。 I updated the R using this solution .我使用此解决方案更新了 R。 Now, devtools package is working.现在,devtools 包正在运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM