It seems that you should install development package version (this means headers) of libcurl with:
sudo apt-get install libcurl4-openssl-dev
Also make sure that you have installed pkg-config. If unsure install it with:
sudo apt-get install pkg-config
Answer from N0rbert on askubuntu.comlibcurl4-openssl-dev is not a R package, but rather a linux library.
In a console type:
sudo apt-get install libcurl4-openssl-dev
Note: you need sudo powers.
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 your
PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config
is 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.
su
wget https://github.com/curl/curl/releases/download/curl-7_55_0/curl-7.55.0.tar.gz
./configure
make
make install
After this, I saw libcurl.pc file in PKG_CONFIG_PATH (/usr/local/lib/pkgconfig/).
No package 'libcurl' found
Install fails because libcurl not found while installed
r - Curl package not installing - Stack Overflow
"Package libcurl was not found" during Github action setup-renv on Ubuntu
I found out that if you install libcurl4-openssl-dev, then make won't complain about the absence of libcurl anymore:
apt-get install libcurl4-openssl-dev
Unfortunately, I'm unable to provide an explanation on why or how this happens (other than the package install this elusive libcurl).
But I have tested and confirmed myself, and it does work. So I'm leaving this answer here.
Further explanation as to why @That Brazilian Guy 's answer works.
libcurl3-dev is provided by several packages, one of which is libcurl4-openssl-dev
First what libcurl is installed? We find that libcurl3 is installed.
# aptitude search libcurl
v libcurl-dev -
v libcurl-dev:i386 -
p libcurl-ocaml - OCaml curl bindings (Runtime Library)
p libcurl-ocaml:i386 - OCaml curl bindings (Runtime Library)
v libcurl-ocaml-d6l49 -
p libcurl-ocaml-dev - OCaml libcurl bindings (Development package)
p libcurl-ocaml-dev:i386 - OCaml libcurl bindings (Development package)
v libcurl-ocaml-dev-d6l49 -
v libcurl-ocaml-dev-ephj1:i386 -
v libcurl-ocaml-ephj1:i386 -
v libcurl-ssl-dev -
v libcurl-ssl-dev:i386 -
i A libcurl3 - easy-to-use client-side URL transfer library (OpenSSL flavour)
p libcurl3:i386 - easy-to-use client-side URL transfer library (OpenSSL flavour)
p libcurl3-dbg - debugging symbols for libcurl (OpenSSL, GnuTLS and NSS flavours
p libcurl3-dbg:i386 - debugging symbols for libcurl (OpenSSL, GnuTLS and NSS flavours
v libcurl3-dev -
v libcurl3-dev:i386 -
i A libcurl3-gnutls - easy-to-use client-side URL transfer library (GnuTLS flavour)
p libcurl3-gnutls:i386 - easy-to-use client-side URL transfer library (GnuTLS flavour)
v libcurl3-gnutls-dev -
v libcurl3-gnutls-dev:i386 -
p libcurl3-nss - easy-to-use client-side URL transfer library (NSS flavour)
p libcurl3-nss:i386 - easy-to-use client-side URL transfer library (NSS flavour)
v libcurl3-nss-dev -
v libcurl3-nss-dev:i386 -
v libcurl3-openssl-dev -
v libcurl3-openssl-dev:i386 -
v libcurl4-dbg -
v libcurl4-dbg:i386 -
v libcurl4-dev -
v libcurl4-dev:i386 -
p libcurl4-doc - documentation for libcurl
p libcurl4-gnutls-dev - development files and documentation for libcurl (GnuTLS flavour
p libcurl4-gnutls-dev:i386 - development files and documentation for libcurl (GnuTLS flavour
p libcurl4-nss-dev - development files and documentation for libcurl (NSS flavour)
p libcurl4-nss-dev:i386 - development files and documentation for libcurl (NSS flavour)
p libcurl4-openssl-dev - development files and documentation for libcurl (OpenSSL flavou
p libcurl4-openssl-dev:i386 - development files and documentation for libcurl (OpenSSL flavou
p libcurlpp-dev - c++ wrapper for libcurl (development files)
p libcurlpp-dev:i386 - c++ wrapper for libcurl (development files)
p libcurlpp0 - c++ wrapper for libcurl
p libcurlpp0:i386 - c++ wrapper for libcurl
Let's try libcurl-dev
# apt-get install libcurl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libcurl-dev is a virtual package provided by:
libcurl4-openssl-dev 7.35.0-1ubuntu2.13
libcurl4-nss-dev 7.35.0-1ubuntu2.13
libcurl4-gnutls-dev 7.35.0-1ubuntu2.13
You should explicitly select one to install.
E: Package 'libcurl-dev' has no installation candidate
Nope, seems to be libcurl4 so let's be wary of that...
Trying libcurl3-dev directly
# apt-get install libcurl3-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libcurl4-openssl-dev' instead of 'libcurl3-dev'
The following extra packages will be installed:
comerr-dev krb5-multidev libgcrypt11-dev libgnutls-dev libgnutlsxx27
libgpg-error-dev libgssrpc4 libidn11-dev libkadm5clnt-mit9 libkadm5srv-mit9
libkdb5-7 libkrb5-dev libldap2-dev libp11-kit-dev librtmp-dev libtasn1-6-dev
Suggested packages:
krb5-doc libcurl4-doc libcurl3-dbg libgcrypt11-doc gnutls26-doc gnutls-bin
krb5-user
The following NEW packages will be installed:
comerr-dev krb5-multidev libcurl4-openssl-dev libgcrypt11-dev libgnutls-dev
libgnutlsxx27 libgpg-error-dev libgssrpc4 libidn11-dev libkadm5clnt-mit9
libkadm5srv-mit9 libkdb5-7 libkrb5-dev libldap2-dev libp11-kit-dev
librtmp-dev libtasn1-6-dev
0 upgraded, 17 newly installed, 0 to remove and 4 not upgraded.
Need to get 2,542 kB of archives.
After this operation, 11.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
So, even libcurl3-dev wants libcurl4-openssl-dev so there we go...
When I am trying for example car, I get this error message:
Installing package into ‘/home/madscientist/R/x86_64-pc-linux-gnu-library/4.0’ (as ‘lib’ is unspecified) also installing the dependencies ‘curl’, ‘rio’ trying URL 'https://cloud.r-project.org/src/contrib/curl_4.3.tar.gz' Content type 'application/x-gzip' length 673779 bytes (657 KB) ================================================== downloaded 657 KB trying URL 'https://cloud.r-project.org/src/contrib/rio_0.5.16.tar.gz' Content type 'application/x-gzip' length 420489 bytes (410 KB) ================================================== downloaded 410 KB trying URL 'https://cloud.r-project.org/src/contrib/car_3.0-8.tar.gz' Content type 'application/x-gzip' length 499932 bytes (488 KB) ================================================== downloaded 488 KB * installing *source* package ‘curl’ ... ** package ‘curl’ successfully unpacked and MD5 sums checked ** using staged installation Package libcurl was not found in the pkg-config search path. Perhaps you should add the directory containing `libcurl.pc' to the PKG_CONFIG_PATH environment variable No package 'libcurl' found Package libcurl was not found in the pkg-config search path. Perhaps you should add the directory containing `libcurl.pc' to the PKG_CONFIG_PATH environment variable No package 'libcurl' found Using PKG_CFLAGS= Using PKG_LIBS=-lcurl ------------------------- 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 your PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config is unavailable you can set INCLUDE_DIR and LIB_DIR manually via: R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...' -------------------------------------------------------------------- ERROR: configuration failed for package ‘curl’ * removing ‘/home/madscientist/R/x86_64-pc-linux-gnu-library/4.0/curl’ Warning in install.packages : installation of package ‘curl’ had non-zero exit status ERROR: dependency ‘curl’ is not available for package ‘rio’ * removing ‘/home/madscientist/R/x86_64-pc-linux-gnu-library/4.0/rio’ Warning in install.packages : installation of package ‘rio’ had non-zero exit status ERROR: dependency ‘rio’ is not available for package ‘car’ * removing ‘/home/madscientist/R/x86_64-pc-linux-gnu-library/4.0/car’ Warning in install.packages : installation of package ‘car’ had non-zero exit status The downloaded source packages are in ‘/tmp/Rtmp7e1hzP/downloaded_packages’
When I tried to install rio and curl libraries separately, and then I installed car again, I had the same problem.
Any advice?
** My OS: Linux mint 19.3
p.s. car package, is not the only package I have this problem.
Hi! I'm trying to plot with themes using the package Theme.Park, I have remote, Theme.Park, rlang, pkconfig, and jsonlite installed and keep getting the error message I don't have curl... okay so then I install curl. Of course, it's not available for my version, so I work my way around and keep getting this error message
Using PKG_CFLAGS= Using PKG_LIBS=-lcurl --------------------------- [ANTICONF] -------------------------------- Configuration failed because libcurl was not found. Try installing: * deb: libcurl4-openssl-dev (Debian, Ubuntu, etc) * rpm: libcurl-devel (Fedora, CentOS, RHEL) If libcurl is already installed, check that 'pkg-config' is in your PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config is unavailable you can set INCLUDE_DIR and LIB_DIR manually via: R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...' -------------------------- [ERROR MESSAGE] --------------------------- <stdin>:1:10: fatal error: curl/curl.h: No such file or directory compilation terminated. -------------------------------------------------------------------- ERROR: configuration failed for package ‘curl’ * removing ‘/home/azannoni/R/x86_64-pc-linux-gnu-library/4.0/curl’ Warning in install.packages : installation of package ‘curl’ had non-zero exit status The downloaded source packages are in ‘/tmp/Rtmp5mh1tL/downloaded_packages’
... I'm at a crossroads and don't know where to go! Thanks!
Just ran into the same issue, this is the solution I found:
Since just installing libcurl4-openssl-dev removes all the r-base packages what I did was
Copysudo apt-get install libcurl4-openssl-dev r-base
and afterwards
CopyR -q -e "install.packages(c('curl'))"
and it worked.
Only caveat is that it upgrades your R version, but if you are already using the latest one then its not an issue.
You are attempting to compile from source. That sometimes has so-called build dependencies. You are missing them, and you are overlooking the (somewhat clear) error messages to that extend because you are getting swamped by multiple installations.
So first tip, so it one package at a time.
Second tip: realize that many (if not all) of these are available within Ubuntu. So just do
Copysudo apt install r-cran-curl
to install e.g. curl. Ditto for the others.
Third tip: There are over 3000 CRAN packages for Ubuntu at Michael's PPA. Read the top of this README and then go this PPA (provided you want 3.5 which you do).