LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   gunzip error (https://www.linuxquestions.org/questions/linux-newbie-8/gunzip-error-590530/)

spangler 10-09-2007 09:24 AM

gunzip error
 
I continue to get this error while trying to unzip a file:


gunzip: blacklists.tar.gz: not in gzip format

Could anyone tell me what other method I should use to unzip this file.

Thank you

dafunks 10-09-2007 09:40 AM

Try:

tar xvf blacklists.tar.gz

student04 10-09-2007 04:12 PM

Quote:

Originally Posted by dafunks (Post 2918419)
Try:

tar xvf blacklists.tar.gz

That will work for files ending in .tar; you are missing the 'z' flag:

Code:

tar xvzf blacklists.tar.gz
will decompress it and extract the contents from the tarball.

To just decompress it, do:
Code:

gunzip blacklists.tar.gz
which will produce blacklists.tar

And just in case you're curious, to recompress the tarball:
Code:

gzip blacklists.tar
Flags of tar:
  • x - extract
  • z - use gunzip compression (*.gz or *.Z)
  • j - use bzip compression (*.bz2)
  • f - next argument is the file to process
  • v - verbose output

If you use gunzip to try and decompress the .tar.gz file and it complains that it is not in gzip format, then maybe the file is not a gz file even though it has that extension.

Try
Code:

file blacklists.tar.gz
See if that tells you if it is a gzipped file.

dafunks 10-09-2007 06:00 PM

tar xvf does the job fine

Screenshot, or it never happened? lol
http://dark-irc.net/dafz/tarxvf.png

student04 10-09-2007 11:41 PM

Ok so I was wrong about omitting the 'z' flag...


Maybe the file is corrupted?

dafunks 10-10-2007 01:41 AM

He might not have been typing the proper gunzip syntax. He only showed the output, not the input. So it is really hard to tell where he was going wrong, but yeah, every chance there was something wrong with the zipped file.

chrism01 10-10-2007 07:29 AM

Woudln't be the first time i've seen a file called file.tar.gz (or file.tgz) and it turned out not to be gzipped....

spangler 10-11-2007 08:06 AM

gunzip error
 
I tried the tar -xvf. That did not work. I got the error
blacklists/
blacklists/CATEGORIES
blacklists/ads/
blacklists/ads/domains

gzip: stdin: unexpected end of file
blacklists/ads/urls
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
tar: blacklists.tar: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
ERROR: unable to extract new lists,
aborting blacklist refresh.

I will now try the tar -zxvf and see if that works.

This is what the command is as it sits now:
# Untaring Blacklist archive.
tar -zxvf blacklists.tar.gz
# gunzip blacklists.tar.gz
tar -xf blacklists.tar
The commented out gunzip was the original command.

Thank you all for your help.

dafunks 10-11-2007 09:34 AM

Weird, did it extract everything in "blacklists/ads/urls"?

Oh well, you got what you needed, thats what counts :)

spangler 10-15-2007 12:31 PM

gunzip error
 
Using the tar -zxvf worked. It is now unzipping the file.

Thank you all for your help.


All times are GMT -5. The time now is 11:00 AM.