curl命令|tar命令 - gzip命令:stdin不是gzip格式。

6
我会尽力帮助您翻译。以下是您需要翻译的内容:

我正在尝试使用以下命令在Travis上安装FFmpeg:

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 .

然而,在 OS X 上它可以本地运行。发生了什么事情呢?

3个回答

1

看起来我刚刚使用了错误的命令!应该是

curl http://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz | sudo tar -C /usr/local/bin/ -xJ --strip-components=1

1

.xz不是.gz。GNU tar 显然识别 XZ 格式;但 OS X 不使用 GNU 工具。我找到了this quote:

无需安装任何东西,可以使用未记录的--xz参数使用tar程序创建带有 XZ 压缩的 TAR 存档。


1
你的tar可能无法处理.xz文件。
根据此链接,你可以尝试安装xz-utils并使用-J标志。
tar -C /path/to/output -xJv

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接