Mac M3 Package install error!

I have been trying to install a few packages for coursework and keep getting the same error codes. I have seen other threads and followed the advice, multiple reinstalls and updates later. Anyone have a resolution or suggestion?

Thanks in advance!!

Mac Air with M3 chip
macOS Sequoia 15.5

Warning in install.packages :
  
error in running command
sh: tar: command not found

Warning in install.packages :
'tar' returned non-zero exit code 127
rror in install.packages : file ‘/var/folders/w0/h2zqb0l13qq47y09qxfpwy_40000gn/T//RtmpPEoiYb/downloaded_packages/pkgconfig_2.0.3.tgz’ is not a macOS binary package

Seems like tar is not part of macOS any more? It is probably included in the XCode Command Line Tools, which you will need later anyway, so I would try installing that.

Hi Gabor, Thanks for your reply!

I installed XCode and am still getting the same error

Hmm, I have a cleanly installed macOS 15.5 system (without any dev tools or anything else installed yet) and it has tar (/usr/bin/tar -> bsdtar) so it's odd that your system is missing this (or maybe the path is messed up?).

I do have that pathway!
Whats the best way to check the pathway for Rstudio? I did a bit of research but tend to spiral down threads.

It seems like it is not an executable file. What do these say?

ls -l /usr/bin/tar
file /usr/bin/tar

aoiferowland@mac ~ % ls -l /usr/bin/tar
file /usr/bin/tar

lrwxr-xr-x 1 root wheel 6 Jul 19 01:13 /usr/bin/tar -> bsdtar
/usr/bin/tar: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e]
/usr/bin/tar (for architecture x86_64): Mach-O 64-bit executable x86_64
/usr/bin/tar (for architecture arm64e): Mach-O 64-bit executable arm64e

What do you get for Sys.getenv("TAR")?

❯ Sys.getenv("TAR")
[1] "/usr/bin/tar"

zsh: no matches found: Sys.getenv(TAR)

You missed the double quotes.

aoiferowland@mac ~ % Sys.getenv("TAR")

[1] "/usr/bin/tar"

zsh: no matches found: Sys.getenv(TAR)

I am not sure what this is, but Sys.getenv("TAR") is an R expression, you need to run it inside R.

Also, while at it, can you also run these from R?

Sys.which("tar")
Sys.which("zip")
Sys.getenv("PATH")

Sys.which("tar")
tar
"/usr/bin/tar"
Sys.which("zip")
zip
"/usr/bin/zip"
Sys.getenv("PATH")
[1] "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"

Still hoping for a resolution on this please, as I have already used my cloud hours!

Well, we are running out of ideas. :frowning: Is you tar functional? E.g. can you run this from a terminal?

cd /tmp
tar --help
touch x
tar czf test.tar.gz x
tar tzf test.tar.gz

I dont understand what I could have done to have affected the programme - Thanks for your help!!

tar(bsdtar): manipulate archive files
First option must be a mode specifier:
-c Create -r Add/Replace -t List -u Update -x Extract
Common Options:
-b # Use # 512-byte records per I/O block
-f Location of archive
-v Verbose
-w Interactive
Create: tar -c [options] [ | | @ | -C ]
, add these items to archive
-z, -j, -J, --lzma Compress archive with gzip/bzip2/xz/lzma
--format {ustar|pax|cpio|shar} Select archive format
--exclude Skip files that match pattern
-C Change to before processing remaining files
@ Add entries from to output
List: tar -t [options] []
If specified, list only entries that match
Extract: tar -x [options] []
If specified, extract only entries that match
-k Keep (don't overwrite) existing files
-m Don't restore modification times
-O Write entries to stdout, don't restore to disk
-p Restore permissions (including ACLs, owner, file flags)
bsdtar 3.5.3 - libarchive 3.7.4 zlib/1.2.12 liblzma/5.4.3 bz2lib/1.0.8
x

Do you have an .Renviron file? Do you have an .Rprofile file? How did you install R?

I installed it directly from the website, nothing special. Followed the instructions and have been running into this issue since install. I have both of these files under /Users//.Renviron

What's the full output of these? (Minus potentially sensitive information.)

system("arch")
sessionInfo()
readLines("~/.Renviron")
readLines("~/.Rprofile")

system("arch")
i386
sessionInfo()
R version 4.4.1 (2024-06-14)
Platform: x86_64-apple-darwin20
Running under: macOS 15.6

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/New_York
tzcode source: internal

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] compiler_4.4.1

readLines("~/.Renviron")
character(0)
readLines("~/.Rprofile")
character(0)