rohitkadam19
rohitkadam19

Reputation: 1874

Unable to unzip tar.gz on ubuntu VM

Performing following steps:-

  1. Host machine is Mac OS X 10.6.8
  2. git archive -o version-$SHA.tar.gz HEAD
  3. scp version-$SHA.tar.gz $Remote_location
  4. ssh to the remote location i.e on ubuntu VM
  5. tar -zxf version-$SHA.tar.gz

After 5th step I get the error:-

gzip: stdin: not in gzip format

tar: Child returned status 1

tar: Error is not recoverable: exiting now

What could be the problem? On my local Mac machine same commands work.

Upvotes: 3

Views: 2325

Answers (2)

Juaniyyoo
Juaniyyoo

Reputation: 87

Did you tried to list it (shouldn't work) ?

tar -ztf version-$SHA.tar.gz

To Gunzip it ?

gunzip version-$SHA.tar.gz

To untar it if it is not gzipped ?

tar xf version-$SHA.tar.gz

Tried to bunzip ?

tar xjf version-$SHA.tar.gz

Tried to unzip ?

unzip version-$SHA.tar.gz

The file isn't not empty (an empty tar is around 10Kio) ?

ls -lk version-$SHA.tar.gz

If neither work, could you do this :

file version-$SHA.tar.gz

Upvotes: 1

Christian Uhl
Christian Uhl

Reputation: 372

Quote from the manpage:

--format= Format of the resulting archive: tar or zip. If this option is not given, and the output file is specified, the format is inferred from the filename if possible (e.g. writing to "foo.zip" makes the output to be in the zip format). Otherwise the output format is tar.

So you got probably a .tar file which not compressed, but just named .tar.gz.

Try without the -z parameter.

Upvotes: 3

Related Questions