Solution to gzip: stdin: invalid compressed data — format violated error in decompressing. Tgz file under Linux

When executing the tar – zxvf xxxx.tgz command,
prompt the following information:
gzip: stdin: invalid compressed data – format violated
tar: child returned status 1
tar: error is not recoverable: exiting now
method 1

    1. reason: the compressed package is not compressed in gzip format, so there is no need to add Z instruction. Solution: use tar – xvf xxxxx.tgz command (i.e. remove Z parameter)

Method 2

      1. rename the downloaded file to tar suffix, MV xx.tgz xx.tar, and then execute the decompression command: tar – zxvf XX. Tar </ OL>

Method 3
add after WGet

 --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" 

For example:

wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/jdk-8u181-linux-x64.tar.gz"

or

wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" -c -O 数据集名字 "对应的网页下载链接"

Read More: