当前位置:   article > 正文

gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting

gzip: stdin: not in gzip format tar: child returned status 1 tar: error is n

问题再现

  1. [root@zh64 ~]# tar zxvf webbench-1.5.tar.gz -C /usr/src/
  2. gzip: stdin: not in gzip format
  3. tar: Child returned status 1
  4. tar: Error is not recoverable: exiting now
  •  查看文件真正的属性
  1. [root@zh64 ~]# file webbench-1.5.tar.gz
  2. webbench-1.5.tar.gz: HTML document, UTF-8 Unicode text, with very long lines, with no line terminators
  3. 问题原因:文件的下载链接不是直接指向文件,而是先指向一个页面,在这个页面里才是真的下载链接,所以在前一个页面上直接保存文件,实际上保存的是一个页面。
  4. 除此外,下面依旧提供几个方法,仅供参考。
  • 重新获取tar包路径,先用浏览器打开,从弹出来的save 对话框里获取下载链接  

  • 在此,补充一下 file 命令
  1. 参  数:
  2.  -b   列出辨识结果时,不显示文件名称。
  3.  -c   详细显示指令执行过程,便于排错或分析程序执行的情形。
  4.  -f <名称文件>  指定名称文件,其内容有一个或多个文件名称呢感,让file依序辨识这些文件,格式为每列
  5. 一个文件名称。
  6.  -L   直接显示符号连接所指向的文件的类别。
  7.  -m <魔法数字文件>  指定魔法数字文件。
  8.  -v   显示版本信息。
  9.  -z   尝试去解读压缩文件的内容。

解决问题

  • 方法一

 tar包压缩的时候用cvf参数,解压的时候用xvf参数或压缩的时候用czvf参数,解压的时候用 xzvf 参数

 对于 bz 包,就把z参数换成相应 j 参数

  1. [root@zh64 ~]# tar xvf webbench-1.5.tar.gz
  2. gzip: stdin: not in gzip format
  3. tar: Child returned status 1
  4. tar: Error is not recoverable: exiting now
  5. 因为我的是 html页面,就不赘述,对号入座.
  • 方法二
  1. 参照网上说是文件进行修改为 tar 结尾的名称.
  2. [root@zh64 test]# mv webbench-1.5.tar.gz webbench-1.5.tar
  3. [root@zh64 test]# tar zxvf webbench-1.5.tar
  4. gzip: stdin: not in gzip format
  5. tar: Child returned status 1
  6. tar: Error is not recoverable: exiting now
  • 方法三
  1. 由于在线下载下来的安装包本身就是损坏的,所以针对解压是徒劳的
  2. 这个可以与 windows 上存放着的安装包进行大小比较.
  • 方法四
  1. gzip: stdin: not in gzip format
  2. tar: Child returned status 1
  3. tar: Error exit delayed from previous errors
  4. 这个是FTP传输的问题,可能在传输时使用的是ASCII传输 改为二进制传输 进行解决.

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/260589
推荐阅读
相关标签
  

闽ICP备14008679号