git2r
git2r copied to clipboard
Failure to compile git2r on Ubuntu 24.04
Hi, I dont know if this is related to the Issue #471 or not.
I em encountering problems when installing git2r from CRAN or from github.
Error: package or namespace load failed for ‘git2r’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/wolass/R/x86_64-pc-linux-gnu-library/4.3/00LOCK-git2r/00new/git2r/libs/git2r.so':
libgit2.so.1.8: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
I have installed lib2git (although could not find it on apt repos in ubuntu 24.04) from source using cmake.
The file that is reporting an error is acutally visible in the system.
❯ sudo find / | grep libgit2.so
/usr/lib/x86_64-linux-gnu/libgit2.so
/usr/local/lib/libgit2.so
/usr/local/lib/libgit2.so.1.8.3
/usr/local/lib/libgit2.so.1.8
I had the same issue on Ubuntu 20.04.6 LTS.
To fix it:
-
Copy libgit2 files and symbolic links:
sudo cp -a /usr/local/lib/libgit2.so* /usr/lib/ -
Copy the git2 include folder:
sudo cp -r /usr/local/include/git2/ /usr/include/ -
Try installing the gitr package again—it should work now.