r-lib / remotes

Install R packages from GitHub, GitLab, Bitbucket, git, svn repositories, URLs
https://remotes.r-lib.org/
Other
330 stars 152 forks source link

`remotes::install_github()` throwing `sh: 1: /usr/bin/tar: not found` error #707

Closed RuiyuRayWang closed 2 years ago

RuiyuRayWang commented 2 years ago

Previously I had used Ubuntu 18.04 LTS and R 4.0.5 After a recent update to Ubuntu 20.04 LTS and R 4.2.0, I tried installing from github and got the following error:

> remotes::install_github("mojaveazure/seurat-disk")
Downloading GitHub repo mojaveazure/seurat-disk@HEAD
sh: 1: /usr/bin/tar: not found
sh: 1: /usr/bin/tar: not found
Error: Failed to install 'SeuratDisk' from GitHub:
  error in running command
In addition: Warning messages:
1: In system(cmd) : error in running command
2: In utils::untar(tarfile, ...) :
  ‘/usr/bin/tar -xf '/tmp/Rtmpc8PpqK/filee715935fb95.tar.gz' -C '/tmp/Rtmpc8PpqK/remotese71578bde6a'’ returned error code 127

I checked my location of tar and got

$ which tar
/bin/tar

So the tar location was changed, after the upgrade.

Did anybody else experience the same issue? How do I fix it?

Thanks! Ray

RuiyuRayWang commented 2 years ago

I solved the issue with

$ sudo mv /bin/tar /usr/bin