R version 3.4.4. Ubuntu 18.04.5 LTS.
install.packages('devtools') The output shows missing "gert", "usethis".
Then I tried to install the failed packages "gert".
install.packages('gert', repos='https://cran.rstudio.com/')
Output is an error of missing "libgit2-dev".
Next, I went to install "libgit2-dev", and failed all the time.
The reason of failure of installing "libgit2" is, one shall install the "git2r" instead. (Reference: https://github.com/libgit2/libgit2 and https://github.com/ropensci/git2r )
** Solve the "gert" below:**
install.packages('git2r') # https://github.com/ropensci/git2r\ install.packages('gert') \
below refers to: https://github.com/r-lib/gert the installation hints. On Linux you need to install libgit2:
Debian: libgit2-dev
Fedora / CentOS: libgit2-devel
For Ubuntu Trusty and Xenial, you can use libgit2 backports from
this ppa:
sudo add-apt-repository ppa:cran/libgit2
sudo apt-get update
sudo apt-get install libgit2-dev
DONE!
After that, the package "usethis" can be installed normally.
install.packages('usethis')
DONE!
In the end, the "devtools" can also be installed normally.
install.packages('devtools') \
The error of "non-zero status" does not show up.
library(devtools)
Loading required package: usethis
Extend story:
the package tidyverse can be intalled successfully after the devtools problem got solved.
Happy end.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.