"gzip: stdin: unexpected end of file" when untaring
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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?
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".
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.