Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'gzip decompression failed' and 'tar: Error exit delayed from previous errors'

Mac OS

I have a file, images.tar.gz. , which contains about 7000 .png images. I need to unzip this file.

But when I use terminal to unzip it

tar zxvf /Users/JourneyWoo/images_002.tar.gz

I always encounter this problem

... ...   
x images/00003910_000.png
x images/00001934_002.png
x images/00002250_001.png: gzip decompression failed
tar: Error exit delayed from previous errors.

In this way, I cannot get the whole dataset in this .tar.gz file due to the break. I also used chmod u+r /Users/JourneyWoo/images_002.tar.gz, but it did not work.

Maybe the problem about one of the png images in this .tar.gz file? How can I deal with this problem? REALLY THANKS!

like image 782
Tozz Avatar asked Oct 27 '17 12:10

Tozz


People also ask

How do I unzip a Tar GZ file?

Simply right-click the item you want to compress, mouseover compress, and choose tar. gz. You can also right-click a tar. gz file, mouseover extract, and select an option to unpack the archive.

What is Tar GZ file?

gz file extension) is a compressed file format used to archive data to take up smaller space. Gzip uses the same compression algorithm as the more commonly known zip but can only be used on a single file. In short, Gzip compresses all the individual files and tar packages them in a single archive. So, a tar.


2 Answers

The problem lies in the fact that Mac OS uses bsdtar. When I have a similar problem, I installed gnutar (most Linux systems use ).

brew install gnu-tar
gtar -ztvf archive.tar.gz
like image 134
mrDzurb Avatar answered Sep 26 '22 16:09

mrDzurb


The file is corrupted. You need to try to get a good copy from wherever it came from, or if it was corrupted when created, you need to get it regenerated from the images. The problem has nothing to do with the .png files. The problem is that the .tar.gz is corrupted.

(By the way "unzip" is the wrong verb here, since it is not a zip file. "extract" would be the correct verb.)

like image 32
Mark Adler Avatar answered Sep 25 '22 16:09

Mark Adler