install curl and readr on R - r

Greeting dear community. I try to install readr but it gives me an error because of there is no curl. I then try to install curl and it asks for another dependency. I verify that in the command prompt but it looks like its already installed. Any idea ? See blow:
Many Thanks
Try to install readr:
> install.packages("readr")
Installing package into ‘/home/oracle/R/x86_64-unknown-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
also installing the dependency ‘curl’
trying URL 'http://cran.rstudio.com/src/contrib/curl_0.9.1.tar.gz'
Content type 'application/x-gzip' length 242408 bytes (236 Kb)
opened URL
==================================================
downloaded 236 Kb
trying URL 'http://cran.rstudio.com/src/contrib/readr_0.1.1.tar.gz'
Content type 'application/x-gzip' length 322890 bytes (315 Kb)
opened URL
==================================================
downloaded 315 Kb
* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
File curl.h not found. Make sure the curl development library is installed, e.g. libcurl4-openssl-dev (deb) or libcurl-devel (rpm).
ERROR: configuration failed for package ‘curl’
* removing ‘/home/oracle/R/x86_64-unknown-linux-gnu-library/3.1/curl’
Warning in install.packages :
installation of package ‘curl’ had non-zero exit status
ERROR: dependency ‘curl’ is not available for package ‘readr’
* removing ‘/home/oracle/R/x86_64-unknown-linux-gnu-library/3.1/readr’
Warning in install.packages :
installation of package ‘readr’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpuTNCiG/downloaded_packages’
Try to install curl
> install.packages("curl")
Installing package into ‘/home/oracle/R/x86_64-unknown-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/curl_0.9.1.tar.gz'
Content type 'application/x-gzip' length 242408 bytes (236 Kb)
opened URL
==================================================
downloaded 236 Kb
* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
File curl.h not found. Make sure the curl development library is installed, e.g. libcurl4-openssl-dev (deb) or libcurl-devel (rpm).
ERROR: configuration failed for package ‘curl’
* removing ‘/home/oracle/R/x86_64-unknown-linux-gnu-library/3.1/curl’
Warning in install.packages :
installation of package ‘curl’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpuTNCiG/downloaded_packages’
Install curl in terminal:
[oracle#localhost data]$ sudo yum -y install curl
Loaded plugins: langpacks
Package curl-7.29.0-19.el7.x86_64 already installed and latest version
Nothing to do
[oracle#localhost data]$ sudo yum -y install libcurl
Loaded plugins: langpacks
Package libcurl-7.29.0-19.el7.x86_64 already installed and latest version
Nothing to do
It looks like libcurl is there ?
[oracle#localhost data]$ locate libcurl
/home/oracle/anaconda/lib/libcurl.a
/home/oracle/anaconda/lib/libcurl.la
/home/oracle/anaconda/lib/libcurl.so
/home/oracle/anaconda/lib/libcurl.so.4
/home/oracle/anaconda/lib/libcurl.so.4.3.0
/home/oracle/anaconda/lib/pkgconfig/libcurl.pc
/home/oracle/anaconda/pkgs/curl-7.38.0-0/lib/libcurl.a
/home/oracle/anaconda/pkgs/curl-7.38.0-0/lib/libcurl.la
/home/oracle/anaconda/pkgs/curl-7.38.0-0/lib/libcurl.so
/home/oracle/anaconda/pkgs/curl-7.38.0-0/lib/libcurl.so.4
/home/oracle/anaconda/pkgs/curl-7.38.0-0/lib/libcurl.so.4.3.0
/home/oracle/anaconda/pkgs/curl-7.38.0-0/lib/pkgconfig/libcurl.pc
/usr/lib64/libcurl.so.4
/usr/lib64/libcurl.so.4.3.0
So does the curl-config is there..
[oracle#localhost data]$ locate curl-config
/home/oracle/anaconda/bin/curl-config
/home/oracle/anaconda/pkgs/curl-7.38.0-0/bin/curl-config
[oracle#localhost data]$

I solved the problem on Ubuntu 14.04 by using this command
sudo apt-get install libcurl4-openssl-dev
Future users can search for the latest libcurl using:
apt-cache search libcurl

The actual problem is:
File curl.h not found.
R suggests a solution:
Make sure the curl development library is installed, e.g. libcurl4-openssl-dev (deb) or libcurl-devel (rpm)
So, try:
sudo yum -y install libcurl-devel

Related

Installing AWS S3 R package

I am trying to install the S3 package on R inorder to save csv output on regressions I am running. I tried to install the S3 package to link the Rstudio server to S3 but with no luck. This is the error I recieved when trying to install the aws.s3 package:
> install.packages("aws.s3", repos = c("cloudyr" = "http://cloudyr.github.io/drat"))
Installing package into ‘/home/jessica/R/x86_64-redhat-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
Warning in install.packages :
dependency ‘httr’ is not available
trying URL 'http://cloudyr.github.io/drat/src/contrib/aws.s3_0.3.20.tar.gz'
Content type 'application/gzip' length 47438 bytes (46 KB)
==================================================
downloaded 46 KB
ERROR: dependency ‘httr’ is not available for package ‘aws.s3’
* removing ‘/home/jessica/R/x86_64-redhat-linux-gnu-library/3.4/aws.s3’
Warning in install.packages :
installation of package ‘aws.s3’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpxNVUj5/downloaded_packages’
I then tried installing the httr depence package but with no success as well.
> install.packages("httr")
Installing package into ‘/home/jessica/R/x86_64-redhat-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependency ‘openssl’
trying URL 'https://cran.rstudio.com/src/contrib/openssl_1.3.tar.gz'
Content type 'application/x-gzip' length 1218896 bytes (1.2 MB)
==================================================
downloaded 1.2 MB
trying URL 'https://cran.rstudio.com/src/contrib/httr_1.4.0.tar.gz'
Content type 'application/x-gzip' length 156356 bytes (152 KB)
==================================================
downloaded 152 KB
* installing *source* package ‘openssl’ ...
** package ‘openssl’ successfully unpacked and MD5 sums checked
Using PKG_CFLAGS=
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because openssl was not found. Try installing:
* deb: libssl-dev (Debian, Ubuntu, etc)
* rpm: openssl-devel (Fedora, CentOS, RHEL)
* csw: libssl_dev (Solaris)
* brew: openssl#1.1 (Mac OSX)
If openssl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a openssl.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 ‘openssl’
* removing ‘/home/jessica/R/x86_64-redhat-linux-gnu-library/3.4/openssl’
Warning in install.packages :
installation of package ‘openssl’ had non-zero exit status
ERROR: dependency ‘openssl’ is not available for package ‘httr’
* removing ‘/home/jessica/R/x86_64-redhat-linux-gnu-library/3.4/httr’
Warning in install.packages :
installation of package ‘httr’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpxNVUj5/downloaded_packages’
Likewise when installing the openssl package. My EC2 instance type is a t2.medium.
Here, both some OS and some R dependencies are needed before installing the aws.s3 package of cloudyr.
aws.s3 depends on three R packages: curl, httr and xml. These depend, in turn, on the libssl, libxml2 and libcurl4-openssl OS libraries.
On a fresh new EC2 instance, assuming a Ubuntu box (but of course there are the equivalent yum packages for Fedora/CentOS/RedHat distros), OS dependences have to be installed for first:
sudo apt-get install -y build-essential libssl-dev libxml2-dev libcurl4-openssl-dev
Then you can install the following R packages, in the specified order:
install.packages('curl')
install.packages('httr')
install.packages('xml2')
install.packages("aws.s3", repos = c("cloudyr" = "http://cloudyr.github.io/drat"))
Hope this helps

curl package not available for several R packages

I just installed ubunutu 18.04 and I successfully install R version 3.5.1. I am having problems installing R packages such as plotly. It seems that the packages curl and httr are not available. The full error message:
> install.packages("plotly")
Installing package into ‘/home/lualeperez/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
also installing the dependencies ‘curl’, ‘openssl’, ‘httr’
trying URL 'https://cloud.r-project.org/src/contrib/curl_3.2.tar.gz'
Content type 'application/x-gzip' length 367047 bytes (358 KB)
==================================================
downloaded 358 KB
trying URL 'https://cloud.r-project.org/src/contrib/openssl_1.0.2.tar.gz'
Content type 'application/x-gzip' length 1194883 bytes (1.1 MB)
==================================================
downloaded 1.1 MB
trying URL 'https://cloud.r-project.org/src/contrib/httr_1.3.1.tar.gz'
Content type 'application/x-gzip' length 147593 bytes (144 KB)
==================================================
downloaded 144 KB
trying URL 'https://cloud.r-project.org/src/contrib/plotly_4.8.0.tar.gz'
Content type 'application/x-gzip' length 1860673 bytes (1.8 MB)
==================================================
downloaded 1.8 MB
* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
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/lualeperez/R/x86_64-pc-linux-gnu-library/3.5/curl’
* installing *source* package ‘openssl’ ...
** package ‘openssl’ successfully unpacked and MD5 sums checked
Using PKG_CFLAGS=
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because openssl was not found. Try installing:
* deb: libssl-dev (Debian, Ubuntu, etc)
* rpm: openssl-devel (Fedora, CentOS, RHEL)
* csw: libssl_dev (Solaris)
* brew: openssl#1.1 (Mac OSX)
If openssl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a openssl.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 ‘openssl’
* removing ‘/home/lualeperez/R/x86_64-pc-linux-gnu-library/3.5/openssl’
ERROR: dependencies ‘curl’, ‘openssl’ are not available for package ‘httr’
* removing ‘/home/lualeperez/R/x86_64-pc-linux-gnu-library/3.5/httr’
ERROR: dependency ‘httr’ is not available for package ‘plotly’
* removing ‘/home/lualeperez/R/x86_64-pc-linux-gnu-library/3.5/plotly’
The downloaded source packages are in
‘/tmp/RtmpNTZBPJ/downloaded_packages’
Warning messages:
1: In install.packages("plotly") :
installation of package ‘curl’ had non-zero exit status
2: In install.packages("plotly") :
installation of package ‘openssl’ had non-zero exit status
3: In install.packages("plotly") :
installation of package ‘httr’ had non-zero exit status
4: In install.packages("plotly") :
installation of package ‘plotly’ had non-zero exit status
I tried to solve the problem by installing libcurl4 by doing
sudo apt-get install libcurl4
but the systems then removes all the r-base dependencies.
I haven't tried to solve the problem with the httr package.
Does any one have any hint on how to solve this problem?
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
sudo apt-get install libcurl4-openssl-dev r-base
and afterwards
R -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
sudo 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).
Fedora 36:
dnf install cmake
dnf install openssl-devel
dnf install libcurl-devel.x86_64

ggplot2 fails to install on R 3.0.2

I am unable to install ggplot2 in R 3.0.2 on Ubuntu.
When I run
install.packages('ggplot2',dependencies = TRUE)
I get the following error.
> install.packages('ggplot2',dependencies = TRUE)
Installing package into ‘/home/gowthamn/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
dependencies ‘plyr’, ‘testthat’ are not available
also installing the dependencies ‘reshape2’, ‘scales’, ‘Hmisc’
trying URL 'http://cran.rstudio.com/src/contrib/reshape2_1.4.1.tar.gz'
Content type 'application/x-gzip' length 34693 bytes (33 Kb)
opened URL
==================================================
downloaded 33 Kb
trying URL 'http://cran.rstudio.com/src/contrib/scales_0.2.4.tar.gz'
Content type 'application/x-gzip' length 40093 bytes (39 Kb)
opened URL
==================================================
downloaded 39 Kb
trying URL 'http://cran.rstudio.com/src/contrib/Hmisc_3.16-0.tar.gz'
Content type 'application/x-gzip' length 629536 bytes (614 Kb)
opened URL
==================================================
downloaded 614 Kb
trying URL 'http://cran.rstudio.com/src/contrib/ggplot2_1.0.1.tar.gz'
Content type 'application/x-gzip' length 2351203 bytes (2.2 Mb)
opened URL
==================================================
downloaded 2.2 Mb
ERROR: dependency ‘plyr’ is not available for package ‘reshape2’
* removing ‘/home/gowthamn/R/x86_64-pc-linux-gnu-library/3.0/reshape2’
Warning in install.packages :
installation of package ‘reshape2’ had non-zero exit status
ERROR: dependency ‘plyr’ is not available for package ‘scales’
* removing ‘/home/gowthamn/R/x86_64-pc-linux-gnu-library/3.0/scales’
Warning in install.packages :
installation of package ‘scales’ had non-zero exit status
ERROR: dependencies ‘plyr’, ‘reshape2’, ‘scales’ are not available for package ‘ggplot2’
* removing ‘/home/gowthamn/R/x86_64-pc-linux-gnu-library/3.0/ggplot2’
Warning in install.packages :
installation of package ‘ggplot2’ had non-zero exit status
ERROR: dependencies ‘ggplot2’, ‘scales’ are not available for package ‘Hmisc’
* removing ‘/home/gowthamn/R/x86_64-pc-linux-gnu-library/3.0/Hmisc’
Warning in install.packages :
installation of package ‘Hmisc’ had non-zero exit status
I also tried
install.packages(c('reshape2','scales'))
Get the error that plyr is not available.
I also upgraded Ubuntu and also reinstalled latest version of R and updated the packages using update.packages(checkBuilt=TRUE).
But, nothing worked. What can I do?
If you do not need the latest version, you can install the packaged version distributed by Ubuntu by using:
sudo apt-get install r-cran-ggplot2
I fixed this problem by typing these command:
$ sudo apt-get install r-cran-plyr
$ sudo apt-get install r-cran-reshape2
You should update your R version (r-base) to the latest.
Command line like:
$ sudo apt-get update
$ sudo apt-get install r-base
updated didn't work for me.
First uninstall R.
Then download 3.2.1 deb file from the link:
http://cran.es.r-project.org/bin/linux/ubuntu/trusty/
Install it by Ubuntu software center.
Run install.packages as regular.
apt-get tracks what repos to look for packages in /etc/apt/sources.list. The default set defined in most people's sources.list does not include CRAN mirrors. For Ubuntu users, you can add the following line to /etc/apt/sources.list:
deb https://<my.favorite.cran.mirror>/bin/linux/ubuntu <linux ver>/
I use 'trusty' Ubuntu version and prefer the berkley cran mirror, so my line looks like:
deb http://cran.cnr.berkeley.edu/bin/linux/ubuntu trusty/
If you need to find out your Ubuntu version, try running:
lsb_release -a
Now apt-get can interact with a CRAN mirror for you. Enjoy!
Download the newest version of r-base (3.2.2) from [http://cran.es.r-project.org/bin/linux/ubuntu/trusty/]
use Ubuntu software Centre to open it and install.
This would update your already installed version to the latest. Then try installing the ggplot2 packgage again. It worked for me like magic.
Good luck with it!!

install devtools package in R [duplicate]

I wish to use the devtools package. I've run the following commands:
> install.packages("devtools", dependencies = TRUE)
....
> library(devtools)
Error in library(devtools) : there is no package called ‘devtools’
What am I doing wrong?
Edit: Here are the results of re-running the install.packages command after restarting the session.
> install.packages("devtools", dependencies = TRUE)
Installing package into ‘/home/evanaad/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Warning: dependencies ‘roxygen2’, ‘BiocInstaller’, ‘rstudio’ are not available
also installing the dependencies ‘httr’, ‘RCurl’
trying URL 'http://cran.at.r-project.org/src/contrib/httr_0.2.tar.gz'
Content type 'application/x-gzip' length 50183 bytes (49 Kb)
opened URL
==================================================
downloaded 49 Kb
trying URL 'http://cran.at.r-project.org/src/contrib/RCurl_1.95-4.1.tar.gz'
Content type 'application/x-gzip' length 870915 bytes (850 Kb)
opened URL
==================================================
downloaded 850 Kb
trying URL 'http://cran.at.r-project.org/src/contrib/devtools_1.4.1.tar.gz'
Content type 'application/x-gzip' length 105214 bytes (102 Kb)
opened URL
==================================================
downloaded 102 Kb
* installing *source* package ‘RCurl’ ...
** package ‘RCurl’ successfully unpacked and MD5 sums checked
checking for curl-config... no
Cannot find curl-config
ERROR: configuration failed for package ‘RCurl’
* removing ‘/home/evanaad/R/x86_64-pc-linux-gnu-library/3.0/RCurl’
ERROR: dependency ‘RCurl’ is not available for package ‘httr’
* removing ‘/home/evanaad/R/x86_64-pc-linux-gnu-library/3.0/httr’
ERROR: dependencies ‘httr’, ‘RCurl’ are not available for package ‘devtools’
* removing ‘/home/evanaad/R/x86_64-pc-linux-gnu-library/3.0/devtools’
The downloaded source packages are in
‘/tmp/RtmptvmTrA/downloaded_packages’
Warning messages:
1: In install.packages("devtools", dependencies = TRUE) :
installation of package ‘RCurl’ had non-zero exit status
2: In install.packages("devtools", dependencies = TRUE) :
installation of package ‘httr’ had non-zero exit status
3: In install.packages("devtools", dependencies = TRUE) :
installation of package ‘devtools’ had non-zero exit status
As per damienfrancois's suggestion, I installed libcurl4-gnutls-dev and the problem was solved.
EDIT (#dardisco)
In your shell:
apt-get -y build-dep libcurl4-gnutls-dev
apt-get -y install libcurl4-gnutls-dev
If you are using Ubuntu/Linux:
sudo apt-get install libcurl4-openssl-dev libssl-dev
In case if you are using CentOS:
Try:
sudo yum -y install libcurl libcurl-devel
I hit this issue with Ubuntu 18.04 and none of the previous answers solved it. Eventually I succeeded by installing devtools with the package manager itself:
sudo apt install r-cran-devtools
I'm on windows and had the same issue.
I used the below code :
install.packages("devtools", type = "win.binary")
Then library(devtools) worked for me.
For my Debian Jessie box, I also included:
sudo apt-get build-dep libxml2-dev
Hint: The r-tool console output is pretty verbose so I would check for any other dependencies.
Then, I finally got it:
> find_rtools()
[1] TRUE
For ubuntu users, run this command in your terminal [Tested in UBUNTU 16.04]
sudo apt-get -y install libcurl4-openssl-dev
post this install libraries the way you usually do in R using
install.packages("package name")
None of the above answers worked for me on Ubuntu 18.04.3 LTS using R version 3.6.1
My guess is this might have something to do with Anaconda3...
What worked for me is:
conda install -c r r-devtools
Then in R
install.packages("rlang")
install.packages("devtools")
sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-conda_cos6-linux-gnu (64-bit)
Running under: Ubuntu 18.04.3 LTS
Matrix products: default
BLAS/LAPACK: /home/tsundoku/anaconda3/lib/R/lib/libRblas.so
locale:
[1] LC_CTYPE=en_CA.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_CA.UTF-8 LC_COLLATE=en_CA.UTF-8
[5] LC_MONETARY=en_CA.UTF-8 LC_MESSAGES=en_CA.UTF-8
[7] LC_PAPER=en_CA.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_CA.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 tools_3.6.1 tcltk_3.6.1
Nowadays (ubuntu 14.04) I need both:
$ sudo apt-get -y install libcurl4-gnutls-dev
$ sudo apt-get -y install libssl-dev
Best solution to solve this. I was searching the same problem. I spent 1 day and then I got solution. Now, It is well.
Check your R version in bash terminal if you are on Ubuntu or Linux.
R --version
then use these commands
sudo apt-get update
sudo apt-get upgrade
Now check the new version of R. Use this command
sudo apt-cache showpkg r-base
Now update the R only.
sudo apt-get install r-base
Now R will be updated and the error will be removed. Make sure to cd the library path where you want to install the new package. This way in bash terminal. Try to create the R directory at home folder or it will be at the default. Locate this location for package ~/R/lib/ .
R
.libPaths("~/R/lib")
install.packages("devtools")
OR
install.packages("devtools", lib="~/R/lib")
I worked through a number of issues installing all of the following to get devtools to install on Ubuntu 18.04.1.
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libssl-dev
sudo apt-get install libcurl4-gnutls-dev
sudo apt-get install libxml2-dev
CentOS 7:
I had the libcurl and gnutls development packages installed already, but still got the "cannot load git2r.so" error when installing devtools in R. I had to "reinstall" them for it to work:
sudo yum reinstall gnutls-devel.x86_64
CentOS 7:
I tried solutions in this post
sudo yum -y install libcurl libcurl-devel
sudo yum -y install openssl-devel
but wasn't enough.
Checking R error in Console gave me the anwser. In my case it was lacking libxml-2.0 below (and Console printed an explanation with package name to different Linux versions and other possible R configs)
sudo yum -y install libxml2-devel
I found solution by seeing errors by R-Studio when I tried to install devtools package...Basically Error is because of dependence libraries not installed in linux Look at ANTICONF ERROR Below
Installing package into ‘/home/hafiz/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
also installing the dependencies ‘curl’, ‘gh’, ‘openssl’, ‘xml2’, ‘usethis’, ‘covr’, ‘httr’, ‘roxygen2’, ‘rversions’
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/gh_1.1.0.tar.gz'
Content type 'application/x-gzip' length 29043 bytes (28 KB)
==================================================
downloaded 28 KB
trying URL 'https://cloud.r-project.org/src/contrib/openssl_1.4.2.tar.gz'
Content type 'application/x-gzip' length 1204168 bytes (1.1 MB)
==================================================
downloaded 1.1 MB
trying URL 'https://cloud.r-project.org/src/contrib/xml2_1.3.2.tar.gz'
Content type 'application/x-gzip' length 271876 bytes (265 KB)
==================================================
downloaded 265 KB
trying URL 'https://cloud.r-project.org/src/contrib/usethis_1.6.1.tar.gz'
Content type 'application/x-gzip' length 255052 bytes (249 KB)
==================================================
downloaded 249 KB
trying URL 'https://cloud.r-project.org/src/contrib/covr_3.5.0.tar.gz'
Content type 'application/x-gzip' length 146148 bytes (142 KB)
==================================================
downloaded 142 KB
trying URL 'https://cloud.r-project.org/src/contrib/httr_1.4.2.tar.gz'
Content type 'application/x-gzip' length 159950 bytes (156 KB)
==================================================
downloaded 156 KB
trying URL 'https://cloud.r-project.org/src/contrib/roxygen2_7.1.1.tar.gz'
Content type 'application/x-gzip' length 254118 bytes (248 KB)
==================================================
downloaded 248 KB
trying URL 'https://cloud.r-project.org/src/contrib/rversions_2.0.2.tar.gz'
Content type 'application/x-gzip' length 41558 bytes (40 KB)
==================================================
downloaded 40 KB
trying URL 'https://cloud.r-project.org/src/contrib/devtools_2.3.1.tar.gz'
Content type 'application/x-gzip' length 373604 bytes (364 KB)
==================================================
downloaded 364 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/hafiz/R/x86_64-pc-linux-gnu-library/3.6/curl’
Warning in install.packages :
installation of package ‘curl’ had non-zero exit status
* installing *source* package ‘openssl’ ...
** package ‘openssl’ successfully unpacked and MD5 sums checked
** using staged installation
Using PKG_CFLAGS=
--------------------------- [ANTICONF] --------------------------------
Configuration failed because openssl was not found. Try installing:
deb: **libssl-dev** (Debian, Ubuntu, etc)
* rpm: openssl-devel (Fedora, CentOS, RHEL)
* csw: libssl_dev (Solaris)
* brew: openssl#1.1 (Mac OSX)
If openssl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a openssl.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] ---------------------------
tools/version.c:1:10: fatal error: openssl/opensslv.h: No such file or directory
1 | #include <openssl/opensslv.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘openssl’
* removing ‘/home/hafiz/R/x86_64-pc-linux-gnu-library/3.6/openssl’
Warning in install.packages :
installation of package ‘openssl’ had non-zero exit status
* installing *source* package ‘xml2’ ...
** package ‘xml2’ successfully unpacked and MD5 sums checked
** using staged installation
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml-2.0' found
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml-2.0' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lxml2
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libxml-2.0 was not found. Try installing:
deb: **libxml2-dev** (Debian, Ubuntu, etc)
* rpm: libxml2-devel (Fedora, CentOS, RHEL)
* csw: libxml2_dev (Solaris)
If libxml-2.0 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libxml-2.0.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 ‘xml2’
* removing ‘/home/hafiz/R/x86_64-pc-linux-gnu-library/3.6/xml2’
Warning in install.packages :
installation of package ‘xml2’ had non-zero exit status
ERROR: dependencies ‘curl’, ‘openssl’ are not available for package ‘httr’
* removing ‘/home/hafiz/R/x86_64-pc-linux-gnu-library/3.6/httr’
Warning in install.packages :
installation of package ‘httr’ had non-zero exit status
ERROR: dependency ‘xml2’ is not available for package ‘roxygen2’
* removing ‘/home/hafiz/R/x86_64-pc-linux-gnu-library/3.6/roxygen2’
Warning in install.packages :
installation of package ‘roxygen2’ had non-zero exit status
ERROR: dependencies ‘curl’, ‘xml2’ are not available for package ‘rversions’
* removing ‘/home/hafiz/R/x86_64-pc-linux-gnu-library/3.6/rversions’
Warning in install.packages :
installation of package ‘rversions’ had non-zero exit status
ERROR: dependency ‘httr’ is not available for package ‘gh’
* removing ‘/home/hafiz/R/x86_64-pc-linux-gnu-library/3.6/gh’
Warning in install.packages :
installation of package ‘gh’ had non-zero exit status
ERROR: dependency ‘httr’ is not available for package ‘covr’
* removing ‘/home/hafiz/R/x86_64-pc-linux-gnu-library/3.6/covr’
Warning in install.packages :
installation of package ‘covr’ had non-zero exit status
ERROR: dependencies ‘curl’, ‘gh’ are not available for package ‘usethis’
* removing ‘/home/hafiz/R/x86_64-pc-linux-gnu-library/3.6/usethis’
Warning in install.packages :
installation of package ‘usethis’ had non-zero exit status
ERROR: dependencies ‘usethis’, ‘covr’, ‘httr’, ‘roxygen2’, ‘rversions’ are not available for package ‘devtools’
* removing ‘/home/hafiz/R/x86_64-pc-linux-gnu-library/3.6/devtools’
Warning in install.packages :
installation of package ‘devtools’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmpexapon/downloaded_packages’
look at bold libraries which are missing
libssl-dev
libxml2-dev
just you need to install these libraries in ubuntu terminal or
whatever operating system you are using you will find relative errors w r t
operating system see errors in details.. R-studio mentioned relative library package name against operating system
for ubuntu i did this
sudo apt-get install libssl-dev
**sudo apt-get install libxml2-dev **
sudo apt-get install libcurl4-openssl-dev
For R version 4.0.2 on Ubuntu 18.0.4, I had to install the the libgit2-dev package:
sudo apt-get install libgit2-dev
After that, worked like a charm.
Centos 6.8
this work like charm for me
install libcurl $yum -y install libcurl libcurl-devel
restart R Software $rstudio-server verify-installation
My personal experience:
I updated both R and RStudio. Then I installed devtools. As it gave me the same issues, I started installing the dependencies as appeared in the line:
`ERROR: dependencies ‘httr’, ‘RCurl’ are not available for package ‘devtools’ ` one by one.
When you install them (for example the xml2 as in my case),
install.packages("xmls2")
It says:
Configuration failed because libxml-2.0 was not found. Try installing:
* deb: libxml2-dev (Debian, Ubuntu, etc)
* rpm: libxml2-devel (Fedora, CentOS, RHEL)
* csw: libxml2_dev (Solaris)
The answer is in the response. Here I went to the command prompt and used:
sudo apt install libxml2-dev
Then I reused the command:
install.packages("xmls2")
I used a similar procedure for all other packages. Then finally,
install.packages("devtools"))
Sometimes one package may block the installation of many other packages. So please start installation from the first dependency on the list.
On Ubuntu 20.04 focal, I needed to run this first:
apt-get update
apt-get install build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev libfontconfig1-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev -y
Then installation of devtools worked.
This might seem like overkill but all were necessary for me (well, I'm not totally sure if build-essential is necessary, but it didn't hurt - I got that from here).
The way I figured which system libraries to install was by looking at the error messages carefully whenever install.packages("devtools") failed, because often the error message would tell you which system library to install, it's just that it was buried in the middle of the error message so it was hard to spot.

Problems installing the devtools package

I wish to use the devtools package. I've run the following commands:
> install.packages("devtools", dependencies = TRUE)
....
> library(devtools)
Error in library(devtools) : there is no package called ‘devtools’
What am I doing wrong?
Edit: Here are the results of re-running the install.packages command after restarting the session.
> install.packages("devtools", dependencies = TRUE)
Installing package into ‘/home/evanaad/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Warning: dependencies ‘roxygen2’, ‘BiocInstaller’, ‘rstudio’ are not available
also installing the dependencies ‘httr’, ‘RCurl’
trying URL 'http://cran.at.r-project.org/src/contrib/httr_0.2.tar.gz'
Content type 'application/x-gzip' length 50183 bytes (49 Kb)
opened URL
==================================================
downloaded 49 Kb
trying URL 'http://cran.at.r-project.org/src/contrib/RCurl_1.95-4.1.tar.gz'
Content type 'application/x-gzip' length 870915 bytes (850 Kb)
opened URL
==================================================
downloaded 850 Kb
trying URL 'http://cran.at.r-project.org/src/contrib/devtools_1.4.1.tar.gz'
Content type 'application/x-gzip' length 105214 bytes (102 Kb)
opened URL
==================================================
downloaded 102 Kb
* installing *source* package ‘RCurl’ ...
** package ‘RCurl’ successfully unpacked and MD5 sums checked
checking for curl-config... no
Cannot find curl-config
ERROR: configuration failed for package ‘RCurl’
* removing ‘/home/evanaad/R/x86_64-pc-linux-gnu-library/3.0/RCurl’
ERROR: dependency ‘RCurl’ is not available for package ‘httr’
* removing ‘/home/evanaad/R/x86_64-pc-linux-gnu-library/3.0/httr’
ERROR: dependencies ‘httr’, ‘RCurl’ are not available for package ‘devtools’
* removing ‘/home/evanaad/R/x86_64-pc-linux-gnu-library/3.0/devtools’
The downloaded source packages are in
‘/tmp/RtmptvmTrA/downloaded_packages’
Warning messages:
1: In install.packages("devtools", dependencies = TRUE) :
installation of package ‘RCurl’ had non-zero exit status
2: In install.packages("devtools", dependencies = TRUE) :
installation of package ‘httr’ had non-zero exit status
3: In install.packages("devtools", dependencies = TRUE) :
installation of package ‘devtools’ had non-zero exit status
As per damienfrancois's suggestion, I installed libcurl4-gnutls-dev and the problem was solved.
EDIT (#dardisco)
In your shell:
apt-get -y build-dep libcurl4-gnutls-dev
apt-get -y install libcurl4-gnutls-dev
If you are using Ubuntu/Linux:
sudo apt-get install libcurl4-openssl-dev libssl-dev
In case if you are using CentOS:
Try:
sudo yum -y install libcurl libcurl-devel
I hit this issue with Ubuntu 18.04 and none of the previous answers solved it. Eventually I succeeded by installing devtools with the package manager itself:
sudo apt install r-cran-devtools
I'm on windows and had the same issue.
I used the below code :
install.packages("devtools", type = "win.binary")
Then library(devtools) worked for me.
For my Debian Jessie box, I also included:
sudo apt-get build-dep libxml2-dev
Hint: The r-tool console output is pretty verbose so I would check for any other dependencies.
Then, I finally got it:
> find_rtools()
[1] TRUE
For ubuntu users, run this command in your terminal [Tested in UBUNTU 16.04]
sudo apt-get -y install libcurl4-openssl-dev
post this install libraries the way you usually do in R using
install.packages("package name")
None of the above answers worked for me on Ubuntu 18.04.3 LTS using R version 3.6.1
My guess is this might have something to do with Anaconda3...
What worked for me is:
conda install -c r r-devtools
Then in R
install.packages("rlang")
install.packages("devtools")
sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-conda_cos6-linux-gnu (64-bit)
Running under: Ubuntu 18.04.3 LTS
Matrix products: default
BLAS/LAPACK: /home/tsundoku/anaconda3/lib/R/lib/libRblas.so
locale:
[1] LC_CTYPE=en_CA.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_CA.UTF-8 LC_COLLATE=en_CA.UTF-8
[5] LC_MONETARY=en_CA.UTF-8 LC_MESSAGES=en_CA.UTF-8
[7] LC_PAPER=en_CA.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_CA.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 tools_3.6.1 tcltk_3.6.1
Nowadays (ubuntu 14.04) I need both:
$ sudo apt-get -y install libcurl4-gnutls-dev
$ sudo apt-get -y install libssl-dev
Best solution to solve this. I was searching the same problem. I spent 1 day and then I got solution. Now, It is well.
Check your R version in bash terminal if you are on Ubuntu or Linux.
R --version
then use these commands
sudo apt-get update
sudo apt-get upgrade
Now check the new version of R. Use this command
sudo apt-cache showpkg r-base
Now update the R only.
sudo apt-get install r-base
Now R will be updated and the error will be removed. Make sure to cd the library path where you want to install the new package. This way in bash terminal. Try to create the R directory at home folder or it will be at the default. Locate this location for package ~/R/lib/ .
R
.libPaths("~/R/lib")
install.packages("devtools")
OR
install.packages("devtools", lib="~/R/lib")
I worked through a number of issues installing all of the following to get devtools to install on Ubuntu 18.04.1.
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libssl-dev
sudo apt-get install libcurl4-gnutls-dev
sudo apt-get install libxml2-dev
CentOS 7:
I had the libcurl and gnutls development packages installed already, but still got the "cannot load git2r.so" error when installing devtools in R. I had to "reinstall" them for it to work:
sudo yum reinstall gnutls-devel.x86_64
CentOS 7:
I tried solutions in this post
sudo yum -y install libcurl libcurl-devel
sudo yum -y install openssl-devel
but wasn't enough.
Checking R error in Console gave me the anwser. In my case it was lacking libxml-2.0 below (and Console printed an explanation with package name to different Linux versions and other possible R configs)
sudo yum -y install libxml2-devel
I found solution by seeing errors by R-Studio when I tried to install devtools package...Basically Error is because of dependence libraries not installed in linux Look at ANTICONF ERROR Below
Installing package into ‘/home/hafiz/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
also installing the dependencies ‘curl’, ‘gh’, ‘openssl’, ‘xml2’, ‘usethis’, ‘covr’, ‘httr’, ‘roxygen2’, ‘rversions’
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/gh_1.1.0.tar.gz'
Content type 'application/x-gzip' length 29043 bytes (28 KB)
==================================================
downloaded 28 KB
trying URL 'https://cloud.r-project.org/src/contrib/openssl_1.4.2.tar.gz'
Content type 'application/x-gzip' length 1204168 bytes (1.1 MB)
==================================================
downloaded 1.1 MB
trying URL 'https://cloud.r-project.org/src/contrib/xml2_1.3.2.tar.gz'
Content type 'application/x-gzip' length 271876 bytes (265 KB)
==================================================
downloaded 265 KB
trying URL 'https://cloud.r-project.org/src/contrib/usethis_1.6.1.tar.gz'
Content type 'application/x-gzip' length 255052 bytes (249 KB)
==================================================
downloaded 249 KB
trying URL 'https://cloud.r-project.org/src/contrib/covr_3.5.0.tar.gz'
Content type 'application/x-gzip' length 146148 bytes (142 KB)
==================================================
downloaded 142 KB
trying URL 'https://cloud.r-project.org/src/contrib/httr_1.4.2.tar.gz'
Content type 'application/x-gzip' length 159950 bytes (156 KB)
==================================================
downloaded 156 KB
trying URL 'https://cloud.r-project.org/src/contrib/roxygen2_7.1.1.tar.gz'
Content type 'application/x-gzip' length 254118 bytes (248 KB)
==================================================
downloaded 248 KB
trying URL 'https://cloud.r-project.org/src/contrib/rversions_2.0.2.tar.gz'
Content type 'application/x-gzip' length 41558 bytes (40 KB)
==================================================
downloaded 40 KB
trying URL 'https://cloud.r-project.org/src/contrib/devtools_2.3.1.tar.gz'
Content type 'application/x-gzip' length 373604 bytes (364 KB)
==================================================
downloaded 364 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/hafiz/R/x86_64-pc-linux-gnu-library/3.6/curl’
Warning in install.packages :
installation of package ‘curl’ had non-zero exit status
* installing *source* package ‘openssl’ ...
** package ‘openssl’ successfully unpacked and MD5 sums checked
** using staged installation
Using PKG_CFLAGS=
--------------------------- [ANTICONF] --------------------------------
Configuration failed because openssl was not found. Try installing:
deb: **libssl-dev** (Debian, Ubuntu, etc)
* rpm: openssl-devel (Fedora, CentOS, RHEL)
* csw: libssl_dev (Solaris)
* brew: openssl#1.1 (Mac OSX)
If openssl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a openssl.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] ---------------------------
tools/version.c:1:10: fatal error: openssl/opensslv.h: No such file or directory
1 | #include <openssl/opensslv.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘openssl’
* removing ‘/home/hafiz/R/x86_64-pc-linux-gnu-library/3.6/openssl’
Warning in install.packages :
installation of package ‘openssl’ had non-zero exit status
* installing *source* package ‘xml2’ ...
** package ‘xml2’ successfully unpacked and MD5 sums checked
** using staged installation
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml-2.0' found
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml-2.0' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lxml2
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libxml-2.0 was not found. Try installing:
deb: **libxml2-dev** (Debian, Ubuntu, etc)
* rpm: libxml2-devel (Fedora, CentOS, RHEL)
* csw: libxml2_dev (Solaris)
If libxml-2.0 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libxml-2.0.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 ‘xml2’
* removing ‘/home/hafiz/R/x86_64-pc-linux-gnu-library/3.6/xml2’
Warning in install.packages :
installation of package ‘xml2’ had non-zero exit status
ERROR: dependencies ‘curl’, ‘openssl’ are not available for package ‘httr’
* removing ‘/home/hafiz/R/x86_64-pc-linux-gnu-library/3.6/httr’
Warning in install.packages :
installation of package ‘httr’ had non-zero exit status
ERROR: dependency ‘xml2’ is not available for package ‘roxygen2’
* removing ‘/home/hafiz/R/x86_64-pc-linux-gnu-library/3.6/roxygen2’
Warning in install.packages :
installation of package ‘roxygen2’ had non-zero exit status
ERROR: dependencies ‘curl’, ‘xml2’ are not available for package ‘rversions’
* removing ‘/home/hafiz/R/x86_64-pc-linux-gnu-library/3.6/rversions’
Warning in install.packages :
installation of package ‘rversions’ had non-zero exit status
ERROR: dependency ‘httr’ is not available for package ‘gh’
* removing ‘/home/hafiz/R/x86_64-pc-linux-gnu-library/3.6/gh’
Warning in install.packages :
installation of package ‘gh’ had non-zero exit status
ERROR: dependency ‘httr’ is not available for package ‘covr’
* removing ‘/home/hafiz/R/x86_64-pc-linux-gnu-library/3.6/covr’
Warning in install.packages :
installation of package ‘covr’ had non-zero exit status
ERROR: dependencies ‘curl’, ‘gh’ are not available for package ‘usethis’
* removing ‘/home/hafiz/R/x86_64-pc-linux-gnu-library/3.6/usethis’
Warning in install.packages :
installation of package ‘usethis’ had non-zero exit status
ERROR: dependencies ‘usethis’, ‘covr’, ‘httr’, ‘roxygen2’, ‘rversions’ are not available for package ‘devtools’
* removing ‘/home/hafiz/R/x86_64-pc-linux-gnu-library/3.6/devtools’
Warning in install.packages :
installation of package ‘devtools’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmpexapon/downloaded_packages’
look at bold libraries which are missing
libssl-dev
libxml2-dev
just you need to install these libraries in ubuntu terminal or
whatever operating system you are using you will find relative errors w r t
operating system see errors in details.. R-studio mentioned relative library package name against operating system
for ubuntu i did this
sudo apt-get install libssl-dev
**sudo apt-get install libxml2-dev **
sudo apt-get install libcurl4-openssl-dev
For R version 4.0.2 on Ubuntu 18.0.4, I had to install the the libgit2-dev package:
sudo apt-get install libgit2-dev
After that, worked like a charm.
Centos 6.8
this work like charm for me
install libcurl $yum -y install libcurl libcurl-devel
restart R Software $rstudio-server verify-installation
My personal experience:
I updated both R and RStudio. Then I installed devtools. As it gave me the same issues, I started installing the dependencies as appeared in the line:
`ERROR: dependencies ‘httr’, ‘RCurl’ are not available for package ‘devtools’ ` one by one.
When you install them (for example the xml2 as in my case),
install.packages("xmls2")
It says:
Configuration failed because libxml-2.0 was not found. Try installing:
* deb: libxml2-dev (Debian, Ubuntu, etc)
* rpm: libxml2-devel (Fedora, CentOS, RHEL)
* csw: libxml2_dev (Solaris)
The answer is in the response. Here I went to the command prompt and used:
sudo apt install libxml2-dev
Then I reused the command:
install.packages("xmls2")
I used a similar procedure for all other packages. Then finally,
install.packages("devtools"))
Sometimes one package may block the installation of many other packages. So please start installation from the first dependency on the list.
On Ubuntu 20.04 focal, I needed to run this first:
apt-get update
apt-get install build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev libfontconfig1-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev -y
Then installation of devtools worked.
This might seem like overkill but all were necessary for me (well, I'm not totally sure if build-essential is necessary, but it didn't hurt - I got that from here).
The way I figured which system libraries to install was by looking at the error messages carefully whenever install.packages("devtools") failed, because often the error message would tell you which system library to install, it's just that it was buried in the middle of the error message so it was hard to spot.

Resources