I'm on Ubuntu Karmic,
gzip 1.3.12
tar 1.22
I've been encountering a few downloaded tar.gz files that tar complains are corrupt. Lots actually.
Now I usually do this:
Code:
tar xvf archive.tar.gz
To extract. Tar sees the gz extension, and its as if I added "z" to the options.
However lately I've had some files where I get the error (event with the 'z' option):
Code:
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors
I and I assumed it was corrupt. I redownloaded... no good. I got suspicious when the 5th different one or so from sourceforge failed extract. A bunch from other sites nailed it home. So some experimenting...
Said it was a gzip file. So far so good.
Code:
gunzip weird.tar.gz
Worked. Getting closer.
Whoa a list of files!
Worked. Huh? Then why did the normal way not work? Even with the 'z' option added?
Code:
tar czf test.tar.gz diroffiles
tar tvf test.tar.gz
Also works.
I dunno. Perhaps tar is compiled against an older gzip library or something. So if you are getting "corrupt" gzip'd tars, try unziping and untaring as separate steps.