Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.
curl -L http://download.transmissionbt.com/files/transmission-2.80.tar.xz -s -o - | tar -xf -

The error:

tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors

However when I do this, It can extract the archive:

curl -LO http://download.transmissionbt.com/files/transmission-2.80.tar.xz
tar xf transmission-2.80.tar.xz

Why did the pipe not work?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

I think you need tar's -J option in your pipe. e.g. | tar -xJf -

The -J option tells tar to use xz compression.

I think that the reason why tar xf transmission-2.80.tar.xz works without -J is that the option is inferred by tar based on the file extension.

share|improve this answer

The pipe did not work because a binary stream does not end with a recognized file extension. The binary stream in this particular case was compressed with LZMA. A tar archive is not the same as some LZMA compressed data. This is exactly what tar told you.

If you let it know what kind of compression (options J, j, z) a tar archive was created with, it will decompress first using that algorithm and recognize the decompressed data stream as a tar archive.

share|improve this answer
    
Yhank you for the thorough explanation sir. –  Pineapple Under the Sea Jul 19 '13 at 8:09

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.