简体   繁体   中英

How to set up R so that it can properly access system utils and binaries like curl, openssl etc?

I am on Fedora 37 and am failing to install tidyverse .

When I first tried install.packages("tidyverse") I got a list of warning saying that said R was unable to resolve the installation of curl, openssl, googlesheets4 among others. More specifically "In install.package("{insert package name}"): installation had non-zero exit status"

And then I tried install.packages(c("tidyverse","ids", "httr", "gargle","rvest", "covr"), dependencies = TRUE) , only to be given the same errors and then some.

The dependencies had dependencies, so is there a way to perhaps allow the installation of sub-dependencies as well?

But more importantly, I do have curl and openssl installed so, this is perhaps more a problem of R not being to find them (unless R's curl is something other than the system curl ).

How can I either set all dependency requests to TRUE or check that R can access system tools and if not make them available to R?

Doing this in Jupyter and the full text from the editor reads:

Installing packages into ‘/home/rijan/R/x86_64-redhat-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)

also installing the dependencies ‘googledrive’, ‘googlesheets4’, ‘openssl’, ‘curl’, ‘jpeg’, ‘aws.ec2metadata’, ‘sodium’


Warning message in install.packages(c("tidyverse", "ids", "httr", "gargle", "rvest", :
“installation of package ‘openssl’ had non-zero exit status”
Warning message in install.packages(c("tidyverse", "ids", "httr", "gargle", "rvest", :
“installation of package ‘curl’ had non-zero exit status”
Warning message in install.packages(c("tidyverse", "ids", "httr", "gargle", "rvest", :
“installation of package ‘jpeg’ had non-zero exit status”
Warning message in install.packages(c("tidyverse", "ids", "httr", "gargle", "rvest", :
“installation of package ‘sodium’ had non-zero exit status”
Warning message in install.packages(c("tidyverse", "ids", "httr", "gargle", "rvest", :
“installation of package ‘aws.ec2metadata’ had non-zero exit status”
Warning message in install.packages(c("tidyverse", "ids", "httr", "gargle", "rvest", :
“installation of package ‘ids’ had non-zero exit status”
Warning message in install.packages(c("tidyverse", "ids", "httr", "gargle", "rvest", :
“installation of package ‘httr’ had non-zero exit status”
Warning message in install.packages(c("tidyverse", "ids", "httr", "gargle", "rvest", :
“installation of package ‘gargle’ had non-zero exit status”
Warning message in install.packages(c("tidyverse", "ids", "httr", "gargle", "rvest", :
“installation of package ‘rvest’ had non-zero exit status”
Warning message in install.packages(c("tidyverse", "ids", "httr", "gargle", "rvest", :
“installation of package ‘covr’ had non-zero exit status”
Warning message in install.packages(c("tidyverse", "ids", "httr", "gargle", "rvest", :
“installation of package ‘googledrive’ had non-zero exit status”
Warning message in install.packages(c("tidyverse", "ids", "httr", "gargle", "rvest", :
“installation of package ‘googlesheets4’ had non-zero exit status”
Warning message in install.packages(c("tidyverse", "ids", "httr", "gargle", "rvest", :
“installation of package ‘tidyverse’ had non-zero exit status”

When switching from Jupyter notebooks to R in terminal, and using the commands install.packages("curl", verbose = TRUE, dependencies = TRUE) I am gettting the following error message:

Installing package into ‘/home/rijan/R/x86_64-redhat-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
system (cmd0): /usr/lib64/R/bin/R CMD INSTALL
--- Please select a CRAN mirror for use in this session ---
also installing the dependency ‘webutils’

trying URL 'https://cloud.r-project.org/src/contrib/webutils_1.1.tar.gz'
Content type 'application/x-gzip' length 24751 bytes (24 KB)
==================================================
downloaded 24 KB

trying URL 'https://cloud.r-project.org/src/contrib/curl_4.3.3.tar.gz'
Content type 'application/x-gzip' length 670416 bytes (654 KB)
==================================================
downloaded 654 KB

foundpkgs: webutils, curl, /tmp/RtmpojeCdr/downloaded_packages/webutils_1.1.tar.gz, /tmp/RtmpojeCdr/downloaded_packages/curl_4.3.3.tar.gz
files: /tmp/RtmpojeCdr/downloaded_packages/webutils_1.1.tar.gz, 
    /tmp/RtmpojeCdr/downloaded_packages/curl_4.3.3.tar.gz
* 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
Package 'libcurl', required by 'virtual:world', not 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
Package 'libcurl', required by 'virtual:world', not 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)
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/rijan/R/x86_64-redhat-linux-gnu-library/4.2/curl’
ERROR: dependency ‘curl’ is not available for package ‘webutils’
* removing ‘/home/rijan/R/x86_64-redhat-linux-gnu-library/4.2/webutils’

The downloaded source packages are in
    ‘/tmp/RtmpojeCdr/downloaded_packages’
Warning messages:
1: In install.packages("curl", verbose = TRUE, dependencies = TRUE) :
  installation of package ‘curl’ had non-zero exit status
2: In install.packages("curl", verbose = TRUE, dependencies = TRUE) :
  installation of package ‘webutils’ had non-zero exit status

Trying sudo dnf install libcurl-devel solved the issue for curl .

The following system dependencies were required for tidyverse to be installed (fedora specific installation commands):

sudo dnf install openssl-devel

sudo dnf install libcurl-devel

sudo dnf install libsodium-devel

sudo dnf install openssl-devel

Not sure why but my Jupyter was not giving out the full error message even with verbose = TRUe with install.packages("curl", verbose = TRUE, dependencies = TRUE) but R in the terminal was a bit more clear.

Unsure if there is a way to automatically fetch system dependencies for a R package.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM