Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

curl | tar - gzip: stdin: not in gzip format

I'm trying to install ffmpeg on travis with this command:

curl http://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz | tar -C /usr/local/bin/ -xvz

I get this error:

$ curl http://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz | tar -C /usr/local/bin/ -xvz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time      Current
                                 Dload  Upload   Total   Spent    Left      Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
gzip: stdin: not in gzip format
tar: Child died with signal 13
tar: Error is not recoverable: exiting now
The command "curl http://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz | tar -C /usr/local/bin/ -xvz" failed and exited with 2 during .

however, it works locally on OS X. what's going on?

like image 562
Jonathan Ong Avatar asked Mar 30 '15 06:03

Jonathan Ong


3 Answers

.xz is not .gz. GNU tar apparently recognises XZ format; but OS X does not use GNU tools. I found this quote:

Without installing anything, a TAR archive can be created with XZ compression using the tar program with the undocumented --xz argument.

like image 187
Amadan Avatar answered Nov 15 '22 09:11

Amadan


seems like i just used the wrong command! should've been

curl http://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz | sudo tar -C /usr/local/bin/ -xJ --strip-components=1
like image 40
Jonathan Ong Avatar answered Nov 15 '22 08:11

Jonathan Ong


Your tar might not be able to handle .xz files.

According tothis link you can try to install xz-utils and use the -J flag:

tar -C /path/to/output -xJv
like image 32
Guenther T. Avatar answered Nov 15 '22 10:11

Guenther T.