installation of package ‘devtools’ had non-zero exit status on Ubuntu installation of package ‘devtools’ had non-zero exit status on Ubuntu curl curl

installation of package ‘devtools’ had non-zero exit status on Ubuntu


The same problem happened to me when I was trying to install "devtools" package on a new machine with Ubuntu 16.04 system.

I tried many answers including the adopted one above, but I still couldn't solve the problem until I noticed another warning information "(as ‘lib’ is unspecified)". Then I realized that I was running R as a normal user while the R base is installed by root. It means the package "devtools" couldn't be installed into the default R library folder and possibly couldn't use some dependent packages. Then the solution became very easy: run R as root user and then install "devtools".

Following the instructions of Dean Attali (https://www.digitalocean.com/community/tutorials/how-to-set-up-r-on-ubuntu-14-04), I summarize the steps below. Just run them in a terminal.

$ sudo apt-get -y install libcurl4-gnutls-dev libxml2-dev libssl-dev$ sudo su  $ R> install.packages('devtools', repos='http://cran.rstudio.com/')

That's it. Since the package is installed by root, it can be used by all users of the system.


For Curl use:

apt-get -y build-dep libcurl4-gnutls-devapt-get -y install libcurl4-gnutls-dev

And you should update the R version to R-3.1.2

wget http://cran.r-project.org/src/base/R-3/R-3.1.2.tar.gz


I m using Ubuntu 16.04 and this is how I solved this issue:

aptitude install libssl-dev

then aptitude packg manage will allow you to choose the right version which is required for installation of devtools. Repeat the same for

aptitude libcurl4-gnutls-devaptitude libxml2-dev

Finally, install this libgit2 lib

devtools::install_github('ropensci/git2r')devtools::load_all()R CMD INSTALL git2r

I could not solve it with apt-get packg manager. Thats all :) !