I wish to use the devtools
package. I\'ve run the following commands:
> install.packages(\"devtools\", dependencies = TRUE)
....
> library
If you are using Ubuntu/Linux:
sudo apt-get install libcurl4-openssl-dev 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")
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
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
In case if you are using CentOS:
Try:
sudo yum -y install libcurl libcurl-devel
Nowadays (ubuntu 14.04) I need both:
$ sudo apt-get -y install libcurl4-gnutls-dev
$ sudo apt-get -y install libssl-dev