0
votes

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.

1
Does this answer help? - xilliam
How exactly did you try to install "libgit2-dev"? That's not an R package. That's a system dependency. Also, is there a reason you are using such an old version of R? - MrFlick
Good reminder. A few packages was demanding older version. I will try to find updated version if exits. - Ling Sun
It is 2021. Why are you using an R binary from 2017 that is four major releases behind? Why an Ubuntu release that is outdated? And if you use those, why not stick with the outdated devtools from the same period? sudo apt-get install r-cran-devtools. - Dirk Eddelbuettel
Good reminder. My ubuntu system is 18.04, this means, I could choose R version 3.4 or 3.6. Some packages I had prefer older R version. I will find updated suits if exits. - Ling Sun

1 Answers

0
votes

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.