Recently I was trying to execute my R scripts on Linux platform (Ubuntu 18.4) and I had difficulties with each package installation process through "package.installation() function.
install.packages("rvest", dependencies = TRUE)
Each time I get an error message like this:
- 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 containinglibcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
------------------------- 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/marcelina/R/x86_64-pc-linux-gnu-library/3.6/curl’
Warning in install.packages :
installation of package ‘curl’ had non-zero exit status"
So I created a new variable PKG_CONFIG_PATH assigning it a path where packages are installed by default.
The default path is:
> .libPaths()  "/home/marcelina/R/x86_64-pc-linux-gnu-library/3.6".
That didn't help, so I added this path value to an environmental variable PATH:
that also didn't work.
I saw some package installation problems on the forum but there seem to be not solved.
Did anybody overcome similar problem?