Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'm trying to extract a tar.xz file with tar in Mac OS X Lion. I'm using bsdtar 2.8.3 - libarchive 2.8.3. I'm able to use tar to extract anything else I've tried (.zip, .tar, .tar.gz, etc.), but when I try to extract the file (this file to be precise) using tar -Jxf cclive-0.7.11.tar.xz, I get this error:

tar: Error opening archive: Child process exited with status 254Child process exited with status 254
share|improve this question

2 Answers 2

up vote 5 down vote accepted

Same error here (tried GNU tar and the one included in OS X).

You are missing the xz compression program which tar tries to use.

Either install a precompiled xz from Sourceforge or, if you are like me, download the source from http://tukaani.org/xz/ and compile it yourself:

$ ./configure
$ make
$ sudo make install

(Unless told otherwise, ./configure installs xz in /usr/local/bin. You possibly want to add it to $PATH.)

Then:

$ xz --decompress cclive-0.7.11.tar.xz
$ l cclive-0.7.11.tar 
-rw-r--r-- 1 jaume 1832960 2012-12-12 15:18 cclive-0.7.11.tar

Now untar as usual:

$ tar xf cclive-0.7.11.tar
share|improve this answer
5  
brew install xz also works if you are already using homebrew –  alanning Mar 1 '13 at 16:17
    
port install xz also works if you are using MacPorts –  Michael Aug 5 at 20:45
brew install xz

.. then repeat the original command

share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

    
This worked for me. Thanks for being concise. –  JGallardo Dec 26 '13 at 21:47

Your Answer

 
discard

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.