How to update RCurl and curl to the version on the host machine?
Asked Answered
C

1

8

Initially I was trying to use devtools::install_github("EdwinTh/padr") where I got the following error:

Error in curl::new_handle() : An unknown option was passed in to libcurl

After some time I found out that devtools uses curl/RCurl which wraps the current version of curlon the host machine.

The host(Ubuntu 14.04.5 LTS) machine version of curl is:

1$ curl -V curl 7.61.0 (x86_64-pc-linux-gnu) libcurl/7.61.0 OpenSSL/1.0.1f zlib/1.2.8 libssh2/1.8.0 librtmp/2.3

where curlis located in:

12$ which curl /usr/local/bin/curl

and is working fine when using curl::new_handle()directly from the terminal

In comparison the curl/RCurl version is:

> RCurl::curlVersion()
$age
[1] 3

$version
[1] "7.35.0"`

I'm assuming that this might be the underlying issue. My problem now is how to let Rs curl/RCurl point to the corresponding version.

I have tried everything I found so far on that topic for R like:

install.packages("RCurl", type="source") and install.packages("curl", type="source")

as well as adjusting curlon the host machine:

wget https://libssh2.org/download/libssh2-1.8.0.tar.gz
tar zxvf llibssh2-1.8.0.tar.gz
cd libssh2-1.8.0
./configure
make
sudo make install 

wget http://curl.haxx.se/download/curl-7.61.0.tar.gz
tar zxvf curl-7.61.0.tar.bz2
cd curl-7.61.0
./configure --with-libssh2=/usr/local
make
sudo make install

But I always get the same version for curl/RCurl 7.35.0 instead of 7.61.0.

Appreciate any insights!

Collotype answered 28/7, 2018 at 13:35 Comment(7)
For starters, you could consider not being on a four-year old release of your distro. With Ubuntu 18.04 you have no such problem. But in short: update the libcurl*-dev package (complications: there are several) and the reinstall RCurl and/or curl.Fauver
Hi @DirkEddelbuettel there are some restrictions hindering to upgrade Ubuntu. But anyway, thanks for taking time to give your opinion. libcurl*-dev was already installed. So basically I removed it and reinstalled sudo apt-get install libcurl4-openssl-dev as well as those two packages without any change in the behaviour.Collotype
If you tell Ubuntu to install from 14.04 it will of install the same package over and over. That is what sticking with a release means. Your problem, in essence, is to figure out where to get a newer curl library built for that release from. And/or how to tell the R packages how to prefer the local one.Fauver
Hmm, I just assumed it is related somehow to the Path for curl /usr/bin/curl vs. /user/local/bin/curl. I thought RCurl or curl in R are referring to /usr/bin/curl. However on echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin: the /usr/local/bincomes before /usr/bin where I have installed the newest curl 7.61.0. running with out errors.Collotype
The binary is not used to build the R package.Fauver
was this ever resolved? same situation, but i've also downloaded the RCurl source, extracted, run ./configure, built and installed and still no goodBonney
So the only way is to update the OS version and update curl?Clerissa
S
0

I'm running Ubuntu 18.04, and ran into the same problem when I tried and failed to install the Tidyerse R package. As a dependency it tried to install curl 4.3 although I have already curl 7.58.0-2ubuntu3.12 installed. So to update the OS wouldn't help as long as R doesn't realize there is already an existing curl version installed.

Solved it for me: sudo apt install libcurl4-openssl-dev and sudo apt install libssl-dev

Seabrook answered 2/2, 2021 at 9:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.