Home » Linux » How to extract tar.xz files in Linux? [closed]

How to extract tar.xz files in Linux? [closed]

Posted by: admin December 2, 2017 Leave a comment

Questions:

How to extract tar.xz files in Linux?

Answers:

Try:

 $ tar xvfJ filename.tar.xz

Note that xz support from tar 1.22 (march 2009).
Check your tar version (and upgrade if needed).

I had a tar 1.15.1, which resulted in:

tar: This does not look like a tar archive
tar: Skipping to next header
tar: Archive contains obsolescent base-64 headers
tar: Read 2144 bytes from /path/to/my_archive.tar.xz
tar: Error exit delayed from previous errors

With a recent tar, a simple tar xpvf will work (for .tar.xz, or .tar.gz):

tar xpvf /path/to/my_archive.tar.xz -C /path/to/extract

(‘extract‘ being the parent directory in which the archive is extracted)

Leave a Reply

Your email address will not be published. Required fields are marked *