tar: Archive is compressed. Use --zstd option appears when you run Ollama's manual Linux
install, which pipes the download from curl straight into tar. GNU tar recognises zstd in a saved
file, but on a pipe it stops and asks for the flag. Add --zstd to the tar side of the
pipe and the same command works.
The Linux docs at v0.35.0 give
curl -fsSL https://ollama.com/download/ollama-linux-amd64.tar.zst | sudo tar x -C /usr.
With the flag it reads ... | sudo tar --zstd -x -C /usr. The alternative is to save the
file first and extract it with tar -xf, where tar detects zstd on its own.
The error
$ curl -fsSL https://ollama.com/download/ollama-linux-amd64.tar.zst | tar x -C /tmp/fix3-owsl/c6/out
tar: Archive is compressed. Use --zstd option
tar: Error is not recoverable: exiting now
curl: (23) Failure writing output to destination
Why it happens
tar has to know how an archive is compressed before it can read it. With -f and a file
name, GNU tar reads the first bytes, sees the zstd signature, and starts the zstd
program for you; that is why tar -xf ollama-linux-amd64.tar.zst works without any
compression flag. Reading from a pipe, it recognises the same signature but will not start the
decompressor itself, so it stops and names the option it needs. The command in the docs relies on
that detection, and GNU tar, the tar Ubuntu ships, does not do it for a stream.
The curl line is a consequence, not a second problem. Error 23 means curl could not write its
output, because tar, the program reading it, had already quit. Nothing was extracted: the target
folder stayed empty, so on a real install /usr is left as it was and you can simply run
the corrected command.
The fix
$ cat /tmp/fix3-owsl/ollama-linux-amd64.tar.zst | tar --zstd -x -C /tmp/fix3-owsl/c6/out2
$ ls /tmp/fix3-owsl/c6/out2 /tmp/fix3-owsl/c6/out2/bin
/tmp/fix3-owsl/c6/out2:
bin
lib
/tmp/fix3-owsl/c6/out2/bin:
ollama
$ du -sh /tmp/fix3-owsl/c6/out2
2.1G /tmp/fix3-owsl/c6/out2
$ /tmp/fix3-owsl/c6/out2/bin/ollama -v
ollama version is 0.34.2
Warning: client version is 0.35.0
The archive arrived on a pipe, as it does from curl, and with --zstd tar ran zstd on it
and unpacked 2.1 GB. The version lines show the new 0.35.0 client talking to the 0.34.2 server
already running on this machine. The same pipe without --zstd had failed first with the
identical message, and the extracted tree matched a plain file extraction byte for byte. Remember
that tar's --zstd still needs the zstd program installed.
How it was reproduced
Ubuntu 24.04.4 under WSL2 with GNU tar 1.35 and zstd 1.5.5, using Ollama v0.35.0's
ollama-linux-amd64.tar.zst (1,427,765,407 bytes). The docs' command was run as written,
except without sudo and with a scratch folder instead of /usr; it failed at
once. For the fix, the archive already on disk was piped with cat rather than downloaded
a second time; tar sees a pipe either way.
Frequently asked
- Why does the Ollama manual install say 'Archive is compressed. Use --zstd option'?
- Because GNU tar does not detect compression on a pipe. The docs pipe curl into tar x; add --zstd so tar knows to run zstd, or download the file first and extract it with tar -xf, which detects zstd by itself.
- Does tar need zstd installed to extract a .tar.zst file?
- Yes. GNU tar runs the zstd program as a helper, which is why its errors appear as zstd: lines, so the zstd program must be installed. On Ubuntu it comes from the zstd package: sudo apt-get install zstd.
- How do I install Ollama on Linux without the install script?
- Download ollama-linux-amd64.tar.zst and extract it into /usr with sudo tar --zstd -x -C /usr, either from a curl pipe or from the saved file. The docs then add an ollama user and a systemd service; the install script does all of this for you.
More decoded errors in the Fixes category. If zstd is missing altogether, see 'This version requires zstd for extraction'.