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

前端 未结 4 1624
旧巷少年郎
旧巷少年郎 2021-02-07 11:09

I\'m trying to install devtools in a PowerPC with a R version 3.1.1 but failed at the end because the curl library:

...
** testing if installed package can be lo         


        
4条回答
  •  再見小時候
    2021-02-07 12:02

    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.

提交回复
热议问题