问题描述
我试图在带有R版本3.1.1的PowerPC中安装devtools,但是由于curl库而最终失败了:
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:
...
** 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
我已经安装了libcurl4-gnutls -dev和libcurl4-openssl-dev,而libcurl版本是7.38.0。
I've already installed libcurl4-gnutls-dev and libcurl4-openssl-dev and the libcurl version is 7.38.0.
有人知道这个解决方法吗?谢谢;)
Does anyone know a fix to this? Thanks ;)
推荐答案
当我尝试在Ubuntu的新计算机上安装 devtools软件包时,我遇到了同样的问题16.04系统。
The same problem happened to me when I was trying to install "devtools" package on a new machine with Ubuntu 16.04 system.
我尝试了许多答案,包括上面采用的答案,但直到注意到另一个警告信息(因为'lib'是未指定)。然后我意识到我是由root用户安装R base时以普通用户身份运行R的。这意味着 devtools软件包无法安装到默认的R库文件夹中,并且可能无法使用某些相关的软件包。然后解决方案变得非常容易:以root用户身份运行R,然后安装 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)". Then I realized that I was running R as a normal user while the R base is installed by root. It means the package "devtools" couldn't be installed into the default R library folder and possibly couldn't use some dependent packages. Then the solution became very easy: run R as root user and then install "devtools".
按照Dean Attali(),我总结了以下步骤。只需在终端中运行它们即可。
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. 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/')
就是这样。由于该软件包是由root用户安装的,因此系统的所有用户都可以使用它。
That's it. Since the package is installed by root, it can be used by all users of the system.
这篇关于在PowerPC中安装“ devtools”软件包的退出状态为非零的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!