How to extract .xz files on Linux – CenOS / Ubuntu / Debian

Cpanel/Whm License $3/mo Plesk License $10/mo Cloudlinux License $5/mo

(: July 26, 2019)

How can I extract .tar.xz or .xz files on my Linux system?. xz is a lossless compression program and file format which incorporates the LZMA/LZMA2 compression algorithms. The XZ format is a single-file compression format and does not offer archiving capabilities.

In this guide, we will see how to extract .xz files on Linux. The process will include the installation of necessary utilities and demonstrates usage with an example.

To extract .xz files on Linux – CenOS / Ubuntu, we need an xz-utils package installed on the system we’re working on. See installation below.

.td_uid_2_5d909a5965a1f_rand.td-a-rec-img{text-align:left}.td_uid_2_5d909a5965a1f_rand.td-a-rec-img img{margin:0 auto 0 0}

Install xz-utils Package on CentOS / Ubuntu / Debian

Install xz-utils package using the relevant package manager for your Linux and matched package name.

--- Ubuntu / Debian ----
$ sudo apt-get install xz-utils

--- CentOS / Fedora / RHEL ---
$ yum install xz

Extract .xz files on Linux

After package installation, extract your file using the command:

$ unxz file.xz

or --decompress option of xz:

$ xz --decompress file.xz

Here are supported options.

Usage: unxz [OPTION]... [FILE]...
Compress or decompress FILEs in the .xz format.

  -z, --compress      force compression
  -d, --decompress, --uncompress
                      force decompression
  -t, --test          test compressed file integrity
  -l, --list          list information about .xz files
  -k, --keep          keep (don't delete) input files
  -f, --force         force overwrite of output file and (de)compress links
  -c, --stdout, --to-stdout
                      write to standard output and don't delete input files
  -0 ... -9           compression preset; default is 6; take compressor *and*
                      decompressor memory usage into account before using 7-9!
  -e, --extreme       try to improve compression ratio by using more CPU time;
                      does not affect decompressor memory requirements
  -T, --threads=NUM   use at most NUM threads; the default is 1; set to 0
                      to use as many threads as there are processor cores
  -q, --quiet         suppress warnings; specify twice to suppress errors too
  -v, --verbose       be verbose; specify twice for even more verbose
  -h, --help          display this short help and exit
  -H, --long-help     display the long help (lists also the advanced options)
  -V, --version       display the version number and exit

With no FILE, or when FILE is -, read standard input.

In my case, I have a file fedora-coreos-30.20190725.0-openstack.qcow2.xz. To extract it, I’ll use:

$ unxz -v fedora-coreos-30.20190725.0-openstack.qcow2.xz 
fedora-coreos-30.20190725.0-openstack.qcow2.xz (1/1)
  100 %     399.9 MiB / 1,555.3 MiB = 0.257    85 MiB/s       0:18      

The .xz file is automatically deleted after decompression.

.td_uid_4_5d909a5965c29_rand.td-a-rec-img{text-align:left}.td_uid_4_5d909a5965c29_rand.td-a-rec-img img{margin:0 auto 0 0}

Related posts

Reports: China’s Regulators Consider Suspending All ICOs

SXI ADMIN

UAE Remittance Firm Launching Ripple-Based Payments in Q1 2019

SXI ADMIN

How to reset lost root password on Ubuntu 18.04 Bionic Beaver Linux

SXI ADMIN

FTC Granted Approval to Sell Off Butterfly Labs’ Bitcoins

SXI ADMIN

What to Expect When Congress Talks Crypto (Twice) Tomorrow

SXI ADMIN

How To Install Rocket.Chat Server on Debian 10 / Ubuntu 18.04

SXI ADMIN

Bitcoin in the Headlines: Press Eyes Skyrocketing Price

SXI ADMIN

Coinbase Has Dropped Its Bid to Trademark ‘BUIDL’

SXI ADMIN

PBoC’s Fintech Research Institute Is Hiring Blockchain Experts

SXI ADMIN

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More