Archlinux and R

Hi guys, I'm having a problem with Rstudio
I have installed rstudio with pamac and when entering I try to install devtools or another packages but I get this error:

> install.packages(c("devtools"))
Installing package into ‘/home/luis/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
* installing *source* package ‘gert’ ...
** package ‘gert’ successfully unpacked and MD5 sums checked
** using staged installation
./configure: línea 26: arch: orden no encontrada
./configure: línea 26: [: =: se esperaba un operador unario
Using PKG_CFLAGS=
Using PKG_LIBS=-lgit2
----------------------------- ANTICONF -------------------------------
Configuration failed to find libgit2 library. Try installing:
 * brew: libgit2 (MacOS)
 * deb: libgit2-dev (Debian, Ubuntu, etc)
 * rpm: libgit2-devel (Fedora, CentOS, RHEL)
If libgit2 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libgit2.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
<stdin>:1:10: error fatal: git2.h: No existe el fichero o el directorio
compilación terminada.
----------------------------------------------------------------------
ERROR: configuration failed for package ‘gert’
* removing ‘/home/luis/R/x86_64-pc-linux-gnu-library/4.1/gert’
ERROR: dependency ‘gert’ is not available for package ‘usethis’
* removing ‘/home/luis/R/x86_64-pc-linux-gnu-library/4.1/usethis’
ERROR: dependency ‘usethis’ is not available for package ‘devtools’
* removing ‘/home/luis/R/x86_64-pc-linux-gnu-library/4.1/devtools’

The downloaded source packages are in
	‘/tmp/RtmprQBkdP/downloaded_packages’
Warning messages:
1: In install.packages(c("devtools")) :
  installation of package ‘gert’ had non-zero exit status
2: In install.packages(c("devtools")) :
  installation of package ‘usethis’ had non-zero exit status
3: In install.packages(c("devtools")) :
  installation of package ‘devtools’ had non-zero exit status

In this particular case you are missing the libgit2 system library, I don't use Arch Linux but I think you can install it with something like

pacman -S libgit2

Altough, I'm not sure about the package name

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.