Configuration failed because libcurl was not found
The Linux release is: CentOS Linux release 7.3.1611 (Core)
In my case, I was trying to install R package: devtools
------------------------- ANTICONF ERROR ---------------------------Configuration failed because libcurl was not found. Try installing: * deb: libcurl4-openssl-dev (Debian, Ubuntu, etc) * rpm: libcurl-devel (Fedora, CentOS, RHEL) * csw: libcurl_dev (Solaris)If libcurl is already installed, check that 'pkg-config' is in yourPATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-configis unavailable you can set INCLUDE_DIR and LIB_DIR manually via:R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
I checked $PATH
, 'pkg-config' was in the PATH. But there is no libcurl.pc file in PKG_CONFIG_PATH (/usr/local/lib/pkgconfig/)
.
Here is how I solved the problem.
suwget https://github.com/curl/curl/releases/download/curl-7_55_0/curl-7.55.0.tar.gz./configuremake make install
After this, I saw libcurl.pc file in PKG_CONFIG_PATH (/usr/local/lib/pkgconfig/
).
I got this error on Ubuntu Server 18.04, despite already having the libcurl4-openssl-dev
apt
package installed. I had to look up where the package installs libcurl.pc
to figure out the command to use:
wget <curl-package-address>R CMD INSTALL --configure-vars='LIB_DIR=/usr/lib/x86_64-linux-gnu/pkgconfig' <curl-file.gz>
(Check the messages above the "ANTICONF ERROR" for the right file to download and install. For the questioner it was https://cran.rstudio.com/src/contrib/curl_2.3.tar.gz
; mine was https://cloud.r-project.org/src/contrib/curl_4.3.tar.gz
.)