Linux / UNIX: Untar / Extract a .lzma Tar Ball

I’ve downloaded a file called file.tar.lzma tar ball from the Internet but I am not able to open tar ball. How do I open or extract a .lzma file under Linux or UNIX like operating systems using command line options?

LZMA (Lempel-Ziv-Markov chain-Algorithm) is an improved version of famous LZ77 compression algorithm. It was improved in way of maximum increasing of compression ratio, keeping high decompression speed and low memory requirements for decompressing.

Task: Extract a .tar.lzma Using tar Command

You can use GNU tar version 1.20+ as follows to extract a .lzma tar ball:

tar --lzma -xvf file.tar.lama

LZMA Compression And Decompression Tool

You can install lzma package as follows under Debian / Ubuntu Linux, enter:
$ sudo apt-get install lzma

CentOS / Fedora / RHEL / Redhat Linux user should use the yum command as follows:
# yum install xz

FreeBSD user should use the following commands:
To install the lzma port, enter:
# cd /usr/ports/archivers/lzma/ && make install clean
OR add the lzma binary package under FreeBSD:
# pkg_add -r lzma

Debian / Ubuntu Linux and FreeBSD: Extract a .lzma File

Type the command as follows:

unlzma file.tar.lzma
ls -l
tar -xvf file.tar


lzma -d filr.tar.lzma
ls -l
tar -xvf file.tar


lzma -cd file.tar.lzma | tar xvf -

Get Information About a .lzma File

Type the command as follows:

lzmainfo file.tar.lzma

Sample output:

Uncompressed size:             Unknown
Dictionary size:               8 MB (2^23 bytes)
Literal context bits (lc):     3
Literal pos bits (lp):         0
Number of pos bits (pb):       2

CentOS / Redhat Linux (RHEL): Extract a .lzma File

Type the command as follows:

xz -d file.tar.lzma
ls -l
tar -xvf file.tar


xz -cd file.tar.lzma | tar xvf -

GUI Tool & CLI Tool Source Code

Use 7-zip tool for Linux or MS-Windows operating systems which is a file archiver with a high compression ratio. You can also download the LZMA SDK provides the documentation, samples, header files, libraries, and tools you need to develop applications that use LZMA compression for UNIX like operating systems.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 8 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
8 comments… add one
  • swapna Nov 9, 2011 @ 15:01

    Sir, it is very informative but how to unpack .lzma in wingm or msys shell.

    Thank you.

    • sntosh Mar 26, 2012 @ 12:38

      please help me how to untar the .lzma

  • santosh Mar 26, 2012 @ 12:39

    please kindly help me how to untar the .lzma

    • WSF Sep 18, 2012 @ 21:15

      Use 7-Zip in Windows environments.

  • Arun Sep 14, 2012 @ 18:57

    Hi Santosh or Swapna,

    use below commands to untar the lzma files with wingm or msys shell.

    tar –lzma -xvf filename.tar.lzma

    Thank you


  • umer May 7, 2013 @ 8:18

    Thank you. It works. I searched many posts on internet about extraction of tar.lzma files but none of them worked.

  • binu May 20, 2013 @ 15:14

    thanks you !

  • suman Aug 21, 2013 @ 12:23

    in redhat linux use like this:

    install lzma rpm with –nodeps

    lzma -d file.tar.lzma
    ls -l
    tar -xvf file.tar

    thats it…cool

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum