LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 02-03-2010, 04:55 AM   #1
merlinblack
LQ Newbie
 
Registered: Dec 2007
Location: Sydney, Australia
Distribution: Ubuntu, Ubuntu Server, Linux From Scratch, Fedora, Mac OSX, and Windows sometimes.
Posts: 20

Rep: Reputation: 0
Unhappy seemingly corrupt downloaded gzip'd tar files


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...
Code:
file weird.tar.gz
Said it was a gzip file. So far so good.
Code:
gunzip weird.tar.gz
Worked. Getting closer.
Code:
tar tvf weird.tar
Whoa a list of files!
Code:
tar xvf weird.tar
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.
 
Old 02-03-2010, 09:55 PM   #2
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,232

Rep: Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024
This may be relevant
Quote:
--format FORMAT
selects output archive format

v7 - Unix V7
oldgnu - GNU tar <=1.12
gnu - GNU tar 1.13
ustar - POSIX.1-1988
posix - POSIX.1-2001

-g, --listed-incremental F
create/list/extract new GNU-format incremental backup
-G, --incremental
create/list/extract old GNU-format incremental backup
http://linux.die.net/man/1/tar
 
1 members found this post helpful.
Old 02-03-2010, 09:57 PM   #3
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian jessie/sid; OpenSuSE; Fedora
Posts: 1,591

Rep: Reputation: 162Reputation: 162
tar zxvf <file.tar.gz>
tar jxvf <file.tar.bz2>
 
0 members found this post helpful.
Old 02-03-2010, 11:35 PM   #4
merlinblack
LQ Newbie
 
Registered: Dec 2007
Location: Sydney, Australia
Distribution: Ubuntu, Ubuntu Server, Linux From Scratch, Fedora, Mac OSX, and Windows sometimes.
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by AwesomeMachine View Post
tar zxvf <file.tar.gz>
tar jxvf <file.tar.bz2>
As I mentioned in the first post, adding 'z' to the options does not help. Except when creating an archive, GNU tar will infer 'z' or 'j' from the file name, if you do not specify it explicitly.

Thanks chrism01, I'll look into that. You might be onto something there.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create .diff.gz/.dsc/.orig.tar.gz from a downloaded tar.gz application? frenchn00b Linux - General 4 05-18-2008 09:09 AM
Installing .tar.gz files downloaded to a separate partition talpa_sai Linux - Newbie 3 09-08-2006 02:06 AM
Recovering files from corrupt TAR archive... johnwyles Linux - Software 8 04-17-2006 04:44 AM
when .tgz files are downloaded they turn into .tar files?!?! Flz Slackware 10 12-20-2005 02:32 PM
getting downloaded rpm/cups and tar files into correct folders mookie2125 Linux - Newbie 4 07-17-2005 08:35 PM


All times are GMT -5. The time now is 05:49 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration