unzip xz file

macOS

1
2
3
4
5
brew install xz
xz -d youfile.xz

unxz < file.tar.xz > file.tar
xz -dc < file.tar.xz > file.tar

Ubuntu

1
2
3
4
5
6
sudo apt install xz-utils
tar xf archive.tar.xz
tar xf archive.tar.gz
tar xf archive.tar

tar cfJ <archive.tar.xz> <files>
1
tar -xJf file.pkg.tar.xz

The -J is the flag that specifically deals with .xz files.