LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 11-11-2007, 10:39 PM   #1
Niflheim
Member
 
Registered: Jan 2005
Location: Québec
Distribution: Mandrake 10.1 Official
Posts: 104

Rep: Reputation: 15
"gzip: stdin: unexpected end of file" when untaring



well that's pretty much it. whenever i try to tar -xvzf blablabla.tar.gz, it says :

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error exit delayed from previous errors

and it's not for just one broken file. i tried every .tar.gz files i have, it says the same damned thing.
what is it?

i'm using ubuntu feisty, latest version. i updated everything minutes ago.

thanks!
 
Old 11-11-2007, 10:53 PM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 62
What happens if you just gunzip the file?
 
Old 11-11-2007, 10:54 PM   #3
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 62
Also, check if tar is aliased:
Code:
type tar
 
Old 11-11-2007, 11:02 PM   #4
Niflheim
Member
 
Registered: Jan 2005
Location: Québec
Distribution: Mandrake 10.1 Official
Posts: 104

Original Poster
Rep: Reputation: 15
when i do "type tar", it says :
tar is hashed (/bin/tar)

and while using gunzip, it says :
gunzip: nameoffile.tar.gz: unexpected end of file
 
Old 11-12-2007, 12:46 AM   #5
indeliblestamp
Member
 
Registered: Feb 2006
Distribution: Fedora
Posts: 341
Blog Entries: 3

Rep: Reputation: 38
I've usually only seen that when my downloads are cut off mid way. Can you try zipping up a local file and then running your command on it again?
Code:
echo "hallo" > tempfile
tar cvf tempfile.tar tempfile
gzip tempfile.tar

tar zxvf tempfile.tar.gz
If that works fine, then there's probably a problem with the packages you downloaded. You could try comparing the filesize in your hard disk with the one in the website to confirm.
 
Old 11-12-2007, 06:35 AM   #6
Niflheim
Member
 
Registered: Jan 2005
Location: Québec
Distribution: Mandrake 10.1 Official
Posts: 104

Original Poster
Rep: Reputation: 15
oyoyoy, i tried but it does not work.
and it does the same for every tar on my computer. the ones that used to work, that i've downloaded and used many times before, do not work now.
i'm at lost. any way to like reinstall gzip or something?
 
Old 11-12-2007, 07:10 AM   #7
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Are these files larger than 2gb? What file system are they on?

Did you try "tar czf test.tar.gz <a couple> <small files>" in your home directory just to test the tar command? One thing I am wondering is if you crossed the filesize limit on a VFAT drive or samba share, truncating the file. Another thing to look at is if there is a problem with the filesystem on the storage device. Or if you saved a link to the archive instead of the archive itself.

What does "file archivename" tell you?

Could you try using gzip, gunzip (or zcat) on there own in a test. Since running gunzip failed, it sounds like the gunzip part failed rather than the tar part. What is the version of gzip that you have now? "gzip --version".
 
Old 11-12-2007, 07:28 AM   #8
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 62
What about a .bz2 file - can you bunzip2 one of these without an error?
 
Old 11-12-2007, 07:05 PM   #9
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,225

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
iirc, I've seen this occasionally before, where there's been an error in the file creation/naming and in fact the file isn't gzipped, in spite of the filename implication. Ditto 'not actually tar file'.
Try just doing the gunzip first (gunzip file.tar.gz) and see what happens.
 
  


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
Simple bash script "unexpected end of line error" snowman81 Programming 11 11-11-2007 09:31 AM
bash "unexpected end of file" script error Runge_Kutta Linux - General 6 05-23-2007 03:36 PM
FC5: File system Crash, "Unexpected inconsistancy ... " SparceMatrix Fedora 1 09-04-2006 05:04 AM
apt-get update error: "gzip: stdin: not in gzip format" haertig Debian 0 08-02-2006 05:21 PM
Can I redirect script output to a file without ">> $LOGFILE" at the end of each line davee Linux - General 1 12-19-2003 05:01 AM


All times are GMT -5. The time now is 11:38 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