-   Linux - Newbie (
-   -   "gzip: stdin: unexpected end of file" when untaring (

Niflheim 11-11-2007 10:39 PM

"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.


matthewg42 11-11-2007 10:53 PM

What happens if you just gunzip the file?

matthewg42 11-11-2007 10:54 PM

Also, check if tar is aliased:

type tar

Niflheim 11-11-2007 11:02 PM

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

indeliblestamp 11-12-2007 12:46 AM

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?

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.

Niflheim 11-12-2007 06:35 AM

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?

jschiwal 11-12-2007 07:10 AM

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".

matthewg42 11-12-2007 07:28 AM

What about a .bz2 file - can you bunzip2 one of these without an error?

chrism01 11-12-2007 07:05 PM

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.

All times are GMT -5. The time now is 10:22 PM.