Cannot decompress .tar.xz file, getting "xz: Cannot exec: No such file or directory" from tar

80,893

The line

tar (child): xz: Cannot exec: No such file or directory

gives you the real error. The xz programm cannot be executed, probably because it is not installed. To install the xz (de)compression tools, issue one of the following commands depending on your distibution:

sudo apt-get install xz-utils          # Debian / Ubuntu
sudo yum install xz                    # RHEL / CentOS
sudo zypper in xz                      # OpenSuSE
sudo pacman -S xz                      # Arch Linux
Share:
80,893

Related videos on Youtube

neubert
Author by

neubert

Apparently, this user prefers to keep an air of mystery about them.

Updated on September 18, 2022

Comments

  • neubert
    neubert over 1 year

    Per How do I uncompress a tarball that uses .xz?, I tried tar xf php-5.6.0RC4.tar.xz and tar -xJf php-5.6.0RC4.tar.xz and in both cases I get the following:

    tar (child): xz: Cannot exec: No such file or directory
    tar (child): Error is not recoverable: exiting now
    tar: Child returned status 2
    tar: Error is not recoverable: exiting now
    

    It's this php-5.6.0RC4.tar.xz.

    I'm running Ubuntu 14.04 LTS.

    What's wrong?

  • TimeTraveler
    TimeTraveler over 3 years
    same solution worked for gzip, error was - tar (child): gzip: Cannot exec: No such file or directory
  • Kevin
    Kevin almost 3 years
    For those using RHEL/CentOS, the install command is simply: yum install xz.
  • mpy
    mpy almost 3 years
    @squareskittles Thanks, I added RHEL and two other distros to my answer.