3

I installed the package libcurl4-openssl-dev on Ubuntu with:

sudo apt-get install libcurl4-openssl-dev 

Then created a new miniconda environment environment where I installed an older version of R with repsect to the R version I have in the "base" environment.

> sessionInfo() R version 3.6.1 (2019-07-05) Platform: x86_64-conda_cos6-linux-gnu (64-bit) Running under: Ubuntu 22.04.1 LTS Matrix products: default BLAS/LAPACK: /home/studenti/miniconda3/envs/biobakery-melonnpan/lib/libopenblasp-r0.3.12.so locale: [1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_GB.UTF-8 LC_COLLATE=en_GB.UTF-8 [5] LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8 [7] LC_PAPER=en_GB.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] compiler_3.6.1 

I wanted to install a list of packages, using:

R -q -e "install.packages(c('devtools', 'glmnet', 'foreach', 'getopt', 'doParallel', 'vegan', 'data.table', 'ggplot2', 'AssocTests', 'optparse', 'tibble'), repos='http://cran.r-project.org')" 

But as an Output I obtained that some dependencies for some packages weren't available, and the packages were not installed.

ERROR: dependency ‘credentials’ is not available for package ‘gert’ removing ‘/home/studenti/miniconda3/envs/biobakery-melonnpan/lib/R/library/gert’ ERROR: dependency ‘httr’ is not available for package ‘gh’ removing ‘/home/studenti/miniconda3/envs/biobakery-melonnpan/lib/R/library/gh’ ERROR: dependencies ‘systemfonts’, ‘textshaping’ are not available for package ‘ragg’ removing ‘/home/studenti/miniconda3/envs/biobakery-melonnpan/lib/R/library/ragg’ ERROR: dependency ‘fExtremes’ is not available for package ‘AssocTests’ removing ‘/home/studenti/miniconda3/envs/biobakery-melonnpan/lib/R/library/AssocTests’ ERROR: dependencies ‘curl’, ‘gert’, ‘gh’ are not available for package ‘usethis’ removing ‘/home/studenti/miniconda3/envs/biobakery-melonnpan/lib/R/library/usethis’ ERROR: dependencies ‘httr’, ‘ragg’ are not available for package ‘pkgdown’ removing ‘/home/studenti/miniconda3/envs/biobakery-melonnpan/lib/R/library/pkgdown’ ERROR: dependencies ‘usethis’, ‘pkgdown’, ‘rcmdcheck’, ‘rversions’, ‘urlchecker’ are not available for package ‘devtools’ removing ‘/home/studenti/miniconda3/envs/biobakery-melonnpan/lib/R/library/devtools’ The downloaded source packages are in ‘/tmp/Rtmp1XU3Vb/downloaded_packages’ Updating HTML index of packages in ‘.Library’ Making ‘packages.html’ … done There were 19 warnings (use warnings() to see them) 

Trying to install them one by one in R using

install.packages(*package*, dependencies=TRUE) 

has given me the output:

------------------------- 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=...' -------------------------------------------------------------------- 

My problem here is that the package libcurl4-openssl-dev is not found when installing R packages and I can't add it to the PATH. Is there someone that could help me? Thank you.

1 Answer 1

2

These are system dependencies, not R packages. If you really want to build your own packages, then you'll need to install libcurl4-openssl-dev through apt in this case.

What is generally recommended on Ubuntu though, is not to build the packages yourself, but to get them as ppa as is described on CRAN.

Sign up to request clarification or add additional context in comments.

3 Comments

Thank you for the clarification! I followed what is written in the instructions and run ""sudo apt install --no-install-recommends r-cran-devtools"" for example, but I have no package devtools when I try to load it from the library, and I don't knwo if it is really installed or it is in a different path.
Make sure the package is actually installed. You can do that with dpkg -s r-cran-devtools | grep Status
If it is installed but R still does not find it, enter dpkg -L r-cran-devtools in the terminal to check where it was installed. Then check with .libPaths() in the R console whether R is looking in the right place

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.