8

I'm using a Sun Sparc System, aka Solaris. I have a .tar.gz file, and I can't figure out how to untar it. The command I usually use doesn't work:

tar -xzvf file.tar.gz 

Anybody know how to do this? I can't be an answer anywhere!

2
  • 1
    Btw you should take note that "Solaris tar is sometimes broken (i.e. can't deal with long directory names etc.)". For more details see bytes.com/topic/python/answers/… and python.org/download/releases/2.4.2/bugs Sep 29, 2009 at 15:50
  • The above comment "Solaris tar is sometimes broken" is wrong. The original Solaris tar only implements the original standardized tar file format. The "breakage" comes from GNU tar (and others) creating extensions to the tar file format without standardization. Saying "Solaris tar is broken" because it can't handle non-tar "tar" files is like saying vi is broken because it can't handle MS Word files. AIX tar can have the same issues with GNU "tar" archives: www-01.ibm.com/support/docview.wss?uid=swg21969357 Jan 30, 2018 at 17:53

2 Answers 2

14

You have to gunzip then untar on Solaris. It should come with GNU tar:

gtar xzvf somefile.tar.gz

if that doesn't work:

gunzip -c somefile.tar.gz |tar xvf -
6
  • Doesn't the z option enable gzip anyway? Sep 29, 2009 at 13:20
  • 1
    it should gunzip and untar in one.
    – user1931
    Sep 29, 2009 at 13:47
  • It does with GNU tar, but the tar that comes with Solaris is not GNU tar and doesn't support that option.
    – wfaulk
    Sep 29, 2009 at 18:38
  • GNU tar comes with the freeware packages to install on Solaris
    – user1931
    Sep 29, 2009 at 20:42
  • 1
    You kids - you've been spoilt with those new-fangled GNU commands! (I tend to do "gzip -dc filename | tar tf -" as an automatic thing, whatever platform, even when it does have a gnu-tar available. After all, even if your tar understands gzip, it might not understand bzip2, 7za, etc...)
    – jrg
    Oct 7, 2009 at 16:51
0

For .bzip2 files I used the following procedure:

bunzip2 filename.tar.bz2

This will remove the bz2 extension.

Then

tar -xvf filename.tar

-v only for verbose mode.

You must log in to answer this question.