18

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

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 ;)

Ben G
  • 4,148
  • 2
  • 22
  • 42
Aida Palacio Hoz
  • 251
  • 1
  • 2
  • 8
  • I've tried to install libcurl4 (it's the only one i've left) and then, intall the curl package but I'm still getting the same :( Thanks for replay ;) – Aida Palacio Hoz Jun 30 '15 at 07:21
  • The problem persists and i need to install devtools because its important to install some packages from github. Anyone? – Aida Palacio Hoz Jul 09 '15 at 08:26
  • I had same problem. your problem corresponding to R version. you should upgrade it to R-3.1.2 (wget http://cran.r-project.org/src/base/R-3/R-3.1.2.tar.gz) – Parisa Taherian Jul 22 '15 at 05:13
  • For uninstall the old version use from this commands in ubuntu ( `code` sudo apt-get --purge remove r-base sudo apt-get --purge remove r-base-dev sudo apt-get --purge remove r-base-core `code`) – Parisa Taherian Jul 22 '15 at 05:30
  • This was still an issue for me in v3.2.4 on Ubuntu 14. @Parisa Taherian's solution below resolved it for me. – killthrush Mar 31 '16 at 12:45

5 Answers5

48

The same problem happened to me when I was trying to install "devtools" package on a new machine with Ubuntu 16.04 system.

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".

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/')

That's it. Since the package is installed by root, it can be used by all users of the system.

Zheng Xiaochen
  • 643
  • 5
  • 8
7

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

wget http://cran.r-project.org/src/base/R-3/R-3.1.2.tar.gz
Parisa Taherian
  • 501
  • 5
  • 10
1

I m using Ubuntu 16.04 and this is how I solved this issue:

aptitude install libssl-dev

then aptitude packg manage will allow you to choose the right version which is required for installation of devtools. Repeat the same for

aptitude libcurl4-gnutls-dev
aptitude libxml2-dev

Finally, install this libgit2 lib

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

I could not solve it with apt-get packg manager. Thats all :) !

0

This error was happening when I was using 3.0.2. I updated the R, now It is fine. 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. Now, devtools package is working.

Community
  • 1
  • 1
Hafiz Shehbaz Ali
  • 2,566
  • 25
  • 21
0

Fedora 34

What did it for me was:

sudo dnf groupinstall "Development tools"

Not sure about that, but also:

sudo dnf install freetype-devel libpng-devel libtiff-devel libjpeg-turbo-devel

Don't know, don't care, but it worked!

Vérace
  • 854
  • 10
  • 41