unxz Archives - Justin Silver https://www.justinsilver.com/tag/unxz/ Technology, Travel, and Pictures Mon, 11 Apr 2016 22:41:06 +0000 en-US hourly 1 https://wordpress.org/?v=6.0.1 https://www.justinsilver.com/wp-content/uploads/2013/06/cropped-apple-touch-icon-160x160.png unxz Archives - Justin Silver https://www.justinsilver.com/tag/unxz/ 32 32 Extract a tar.xz file on CentOS and RedHat https://www.justinsilver.com/technology/linux/extract-tar-xz-file-centos-redhat/?utm_source=rss&utm_medium=rss&utm_campaign=extract-tar-xz-file-centos-redhat https://www.justinsilver.com/technology/linux/extract-tar-xz-file-centos-redhat/#comments Thu, 30 Oct 2014 00:17:53 +0000 http://justinsilver.com/?p=3789 This guide will show you how to extract a tar.xz file on CentOS or RedHat, and probably other flavors of Linux as well. Traditionally compressed archive files are distributed on Linux systems as tar.gz...

The post Extract a tar.xz file on CentOS and RedHat appeared first on Justin Silver.

]]>
AmpedSense.OptimizeAdSpot('AP'); AmpedSense.OptimizeAdSpot('IL'); AmpedSense.OptimizeAdSpot('IR');

This guide will show you how to extract a tar.xz file on CentOS or RedHat, and probably other flavors of Linux as well. Traditionally compressed archive files are distributed on Linux systems as tar.gz files which use gzip for compression. Extracting them is as simple as passing xzf to tar.

tar -xvf filename.tar.gz

If you try the same thing using a tar.xz file, you’ll find that it doesn’t work.

tar -xzf filename.tar.xz
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error exit delayed from previous errors

On newer versions of tar, you can simply replace the z with a J to use the correct (de)compression library, but if you have version 1.15.1 or earlier, you’ll find that this doesn’t work either. Note that this is a capital “J” and not a lowercase “j” which would be used to specify bzip2 compression.

tar -xJf gnutls.tar.xz
tar: invalid option -- J
Try `tar --help' or `tar --usage' for more information.

Getting around this is as simple as using the xz binary to first decompress the file, and then tar to extract it. If you don’t already have it, you can install xz using yum.

yum -y install xz
unxz filename.tar.xz
tar -xf filename.tar

The post Extract a tar.xz file on CentOS and RedHat appeared first on Justin Silver.

]]>
https://www.justinsilver.com/technology/linux/extract-tar-xz-file-centos-redhat/feed/ 7