Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying extract .tar.gz file it but with no luck

gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

the file tar.gz include another file.tar only which is has the issue

when i trying to extract .tar file i got

tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

i tried –ignore-zeros –ignore-failed-read with no luck

file type tar.gz: gzip compressed data, from Unix

how could i extract this file even if it corrupted ?

share|improve this question

You don't. It appears the file has been truncated. How long is it? If you only have the first few bytes then you're done.

share|improve this answer

Check two items:

(1) Is the FILE INCOMPLETE due to a faulty download? Re-download, and use the -c option if your are using wget. (happens all the time).

(2) Does the .tar or .tar.gz filename have ILLEGAL CHARACTERS. It's best to keep archive names simple, short, composed of letters and numbers. (happens all the time). So just rename the file. This one nailed me recently as I thought it would be convenient to include a time/date stamp as part of the archive name. BAD IDEA!

share|improve this answer
Solved my issue. Many thanks. – The Humble Rat Jun 23 at 19:19

are you unpacking the .tar.gz file on the same platform it was made on? there are some differences between older Unix versions of tar, such as the non-GNU versions of tar that have shipped with Solaris, and the GNU tar that ships with Linux, etc. If you're going to unpack an archive with GNU tar, it's best to create it with GNU tar.

how does your system look for disk space? was the disk full when you made the archive, or is it full as you attempt to unpack it?

did you create the archive with a cron job? without output redirection, cron can do funky things to archives due to limitations in the size of output it will allow to STDOUT. If you're making an archive in cron, and you're using -v with tar, try redirecting STDOUT to a file, and STDERR, too. See if that helps. tar -cvf archive.tar.gz /path/ 1>archive.stdout.log 2>archive.stderr.log or something like that.

share|improve this answer
i am trying to extract cpanel backup site made by .tar.gz , the problem is this site large over 13 G.B and i think it didn't backup the file as well , so it's corrupted , all i want is how could i skip the corrupted files and extract the files has been packed as well ? – iLinux85 Nov 5 '12 at 15:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.