Softpedia
 

NEWS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
Home > News > Linux > Open Source Software

October 21st, 2009, 13:01 GMT · By

Introducing LZMA and XZ Compression Algorithms

SHARE:

Adjust text size:


Powered by Linux logo
Enlarge picture
We've decided to write a little article about some recent compression algorithms found in various bleeding-edge Linux distributions, especially for newcomers to this open source and free operating system. We guess that some of you already know about the classic archive types, such as tar.gz or tar.bz2, which are mostly encountered whenever you get your hands dirty with Linux.

But today we will introduce you to two high-compression utilities: LZMA and XZ. Why? Simply because, you will definitely encounter in the near feature more and more tar.lzma or tar.xz archives, and you will either have no idea what they are and what to do with them, or you will not have the required packages to extract such archives.

Developed since 1998, LZMA (Lempel-Ziv-Markov chain-Algorithm) is a data archiving utility with a high-compression ratio. Yes, that means smaller archives! How small? Well, even if we can't provide a real benchmark for it, from our experience the outputted archives are two times smaller in some cases, compared with an old tar.gz archive. On the other hand, the XZ compression algorithm is much newer, is based on the Lempel-Ziv/Markov-chain compression method and it is designed to replace the LZMA package. That means, XZ is faster and it produces even smaller archives. But the best part is that it can also read the tar.lzma archives!

Review image
tar.xz archiving in Ubuntu 9.10

It's a known fact that upcoming Linux operating systems, such as Ubuntu 9.10 (Karmic Koala) or Fedora 12 (Constantine), will provide the LZMA and XZ compression utilities. However, installing one of them, it will automatically uninstall the other one. Archives such as tar.lzma and tar.xz are making their way onto our Linux section and we strongly suggest to use the newer XZ (xz-utils package in Ubuntu) compression software for your daily archiving tasks.

LZMA and XZ can also be downloaded as source archives from Softpedia, see below for download links. To learn more about the .xz file formats, check out this website.

Download LZMA Utils from Softpedia.

Download XZ Utils from Softpedia.

TELL US WHAT YOU THINK:

13,550 hits · 9 comments · Link to this article · Print article · Send to friend · Subscribe to news

MUST-READ RELATED ARTICLES:


Happy Birthday, Ubuntu!

Fedora 12 Beta Is Available for Download

MontaVista Linux Carrier Grade Edition Brings Support for 4G and LTE Networks

Softpedia Linux Weekly, Issue 67

LinuxConsole 1.0.2009 Is Out

READER COMMENTS:


Comment #1 by: VezaR on 21 Oct 2009, 18:05 UTC reply to this comment

I was testing Ubuntu 9.04 in tar.lzma. It compresses more but is slower compared to compress zip and tar.gz Question:
1 .- Do you know if tar.lzma and zx are stable enough to work and recommend them?
2 .- Any chance that unseating tar.gz as a favorite in the upcoming Linux distributions?
3 .- What if he comes by default with Ubuntu 9.10?
Thanks for your article, the truth is I I did not know these Compressions Algorithms.

P.D: Sorry for my english. I would like spanish softpedia. =)

Comment #1.1 by: Marius Nestor on 24 Oct 2009, 07:03 GMT

- Yes they are stable enough to work with them. However, tar.lzma is no longer developed, it has been replaced by tar.xz. This is the future of Linux archiving!
- As you can see in the screenshot above, if tar.xz is selected, it will be the default for all the archives you'll create.
- There is no default compression algorithm for Ubuntu. They are all available, so you can extract every possible archive.


Comment #2 by: Antonio Diaz Diaz on 20 Nov 2009, 03:00 UTC reply to this comment

This article is pure propaganda of two bad file formats.
The lzma_alone file format (.lzma) lacks file type information (magic bytes) and integrity checking. So, if you value your data, don't use it.
Xz is not yet stable, and the xz file format is so convoluted that even its own developer uses it inconsistently (http://lists.gnu.org/archive/html/lzip-bug/2009-10/msg00012.html).
Next time, before "instructing" others in the ways of Linux, please, document yourself a little better.

Comment #2.1 by: Marius Nestor on 20 Nov 2009, 09:15 GMT

Dear Antonio, the article is NOT for people like you, experts in Linux, it is ONLY for beginners... for users that will (probably) download software from our website, archives such as tar.lzma and tar.xz, and they will have no idea what to do with them.

Comment #2.2 by: me on 04 Mar 2010, 19:35 GMT

"we strongly suggest to use the newer XZ (xz-utils package in Ubuntu) compression software for your daily archiving tasks."

It sounds like you're doing exactly what Antonio suggets.

Comment #2.3 by: uz64 on 29 Oct 2010, 02:09 GMT

xz must not be that bad if Slackware is using it as the primary compression algorithm for its packages in the latest versions of the distro. Slackware is known for its resistance to change in favor of its philosophy and stability, so that's saying something.

Either way, I've tried both .lzma and .xz, and they both seem similar. They both take a while to compress, but compress very well. It seemed that, with the default settings, the lzma command line tool compresses slightly better (but quite a bit slower) than the equivalent xz command. I timed it, using the time command, with the same file--the 11GB binary file compressed to 2.0 with LZMA, 2.1 with xz. Times (real) were 311m44.798s for LZMA and 226m56.551s for xz. Yes, it was the exact same file (used the -k switch), so any fragments while compressing with one program had to be dealt with in the other as well for fairness.

It does seem like xz is still in development, which is both bad (still not "complete" like its ancient cousins gzip and bzip2) and good (even gzip and bzip needed years of development to get where they both are today!). For example, its man page mentions a "list" feature, which it says will be mapped to the -l switch, but it has not been implemented. I'll just say, based on the pure functionality of this thing (just read through its man page for the list of features and switches), I'm impressed so far with xz. I like it.

Comment #2.4 by: Marius Nestor on 29 Oct 2010, 09:16 GMT

Of course... and now Ubuntu 10.10 has xz and lzma installed by default... maybe Antonio realizes now that XZ is good for everyone... :|


Comment #3 by: Mark E on 28 Apr 2010, 14:17 UTC reply to this comment

I downloaded the xz package with yum, but I didn't seem to get any man pages with it.
I worked out what I needed to do by running xz --help.
One would hope to eventually have a command line switch for tar, like you do for gzip/gunzip, but I don't know what letter you will use!!

Comment #3.1 by: Bob on 13 May 2010, 17:41 GMT

"One would hope to eventually have a command line switch for tar, like you do for gzip/gunzip, but I don't know what letter you will use!!"

tar already has it, it's -J. From man tar:

-j, --bzip2

-J, --xz

Copyright © 2001-2012 Softpedia. Contact/Tip us at

WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM