tar zxvf 解压tar文件出现gzip: stdin: not in gzip format 错误

1. 下载mysql-5.7.29

在mysql网站下载mysql 5.7.29社区版本,安装环境:Suse linux leap 15.1

2. 解压

用tar解压:

#tar zxvf mysql-5.7.29-1.sles12.x86_64.rpm-bundle.tar,出现错误:

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

3. 原因

这个tar文件不是一个gzip文件,不是gZip格式,而是一个POSIX tar文件,用file命令查看:

# file mysql-5.7.29-1.sles12.x86_64.rpm-bundle.tar

mysql-5.7.29-1.sles12.x86_64.rpm-bundle.tar: POSIX tar archive (GNU)

4. 解决办法

#tar xvf mysql-5.7.29-1.sles12.x86_64.rpm-bundle.tar

去掉参数z, 用这种格式可以解压出:

mysql-community-client-5.7.29-1.sles12.x86_64.rpm
mysql-community-common-5.7.29-1.sles12.x86_64.rpm
mysql-community-devel-5.7.29-1.sles12.x86_64.rpm
mysql-community-embedded-5.7.29-1.sles12.x86_64.rpm
mysql-community-embedded-devel-5.7.29-1.sles12.x86_64.rpm
mysql-community-libs-5.7.29-1.sles12.x86_64.rpm
mysql-community-server-5.7.29-1.sles12.x86_64.rpm
mysql-community-test-5.7.29-1.sles12.x86_64.rpm

完成。

 

你可能感兴趣的:(Linux)