Errors with install_cmdstan(): Problem extracting tarball. Exited with return code: 128


Am trying to install cmdstan via RStudio. I have looked through threads and found a close thread which does not deal with my error (quite): Cmdstan not installing - Interfaces / CmdStan - The Stan Forums (

R version 4.3.1

I have successfully installed cmdstanr package:

> install_cmdstan()
The C++ toolchain required for CmdStan is setup properly!
trying URL ''
Content type 'application/json; charset=utf-8' length 18055 bytes (17 KB)
downloaded 17 KB

* Latest CmdStan release is v2.33.0
* Installing CmdStan v2.33.0 in C:/Users/
* Downloading cmdstan-2.33.0.tar.gz from GitHub...
trying URL ''
Content type 'application/octet-stream' length 51049232 bytes (48.7 MB)
downloaded 48.7 MB

* Download complete
* Unpacking archive...
/usr/bin/tar: Cannot connect to C: resolve failed
Error: Problem extracting tarball. Exited with return code: 128
In addition: Warning message:
In utils::untar(dest_file, exdir = dir_cmdstan, extras = "--strip-components 1") :
  ‘tar.exe -xf "C:/Users/" -C "C:/Users/" --strip-components 1’ returned error code 128
> system("tar.exe")
/usr/bin/tar: You must specify one of the '-Acdtrux', '--delete' or '--test-label' options
Try '/usr/bin/tar --help' or '/usr/bin/tar --usage' for more information.
[1] 2
> cmdstanr::check_cmdstan_toolchain(fix=TRUE)
The C++ toolchain required for CmdStan is setup properly!
> find_rtools()
[1] TRUE
> Sys.getenv('PATH')
[1] "C:\\rtools43\\x86_64-w64-mingw32.static.posix\\bin;C:\\rtools43\\usr\\bin;C:\\Program Files\\R\\R-4.3.1\\bin\\x64;C:\\Program Files\\OpenSSH-Win64;C:\\Windows;C:\\Windows\\System32\\wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0;C:\\Program Files\\Microsoft SQL Server\\150\\Tools\\Binn;C:\\Program Files\\Microsoft SQL Server\\Client SDK\\ODBC\\170\\Tools\\Binn;C:\\Program Files\\dotnet;C:\\Program Files\\Git\\cmd;C:\\Program Files (x86)\\Windows Kits\\10\\Windows Performance Toolkit;C:\\rtools43\\usr\\bin;C:\\rtools43\\mingw64\\bin;C:\\Users\\\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Program Files\\RStudio\\resources\\app\\bin\\quarto\\bin;C:\\Program Files\\RStudio\\resources\\app\\bin\\postback"

Having had a spirited attempt at googling the problem am now stumped.
Please could anyone give me a pointer on where to look next?

Thanks in advance and I’m a newbie here so I hope I haven’t missed anything bvious.
Please provide this additional information in addition to your question:

  • Operating System: Windows10
  • CmdStan Version: cmdstan-2.33.0
  • Compiler/Toolkit:Rtools43

@jonah @rok_cesnovar

Weird error. Seems to imply tar isn’t working. @rok_cesnovar knows (a lot) more about Windows than I do, so he might have a good suggestions, but I checked to see if I could find any similar issues reported and the closest thing I’ve seen to this is

which ended up being solved by

(However that was with Rtools42 and it looks like you have 43, so I’m not sure if it’s relevant.)

Worst case scenario I guess you could download CmdStan and unpack it yourself and point cmdstanr to the location using set_cmdstan_path() and then run rebuild_cmdstan().

Thanks! I’ll wait to see if there’s more suggestions and if not then try to do the install manually like you said.