Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I was wondering since in Ubuntu 10.10 I have the ability to create both xz and lzma archives. Should I switch to xz?

http://en.wikipedia.org/wiki/Xz

http://en.wikipedia.org/wiki/Lzma

share|improve this question

2 Answers 2

up vote 7 down vote accepted

This benchmark provides some good information about this issue. It seems that LZMA has slightly better compression ratios and performance than XZ but XZ is generally preferred due to 'practical reasons' (I'm not sure what these are).

XZ is an implementation of the lzma2 algorithm and is better at compressing 'uncompressable' data:

lzma2 is the method of compression employed by the 7-Zip LZMA2 compressor. LZMA2 is a modified version of LZMA that offers a better compression ratio for uncompressible data (random data expands about 0.005%, compared to 1.35% with original LZMA), and optionally can compress multiple parts of large files in parallel, greatly increasing compression speed but with a possible reduction in compression ratio (see LZMANumBlockThreads). Like LZMA, it can consume a lot of memory; see the above table. If a compression level isn't specified, it defaults to max.

(http://www.jrsoftware.org/ishelp/index.php?topic=setup_compression)

You should be OK using either.

share|improve this answer
    
Thanks for the good answer! :) –  NightwishFan Oct 10 '10 at 15:56
    
Out of curiosity, did you decide which to use? –  dv3500ea Oct 10 '10 at 15:59
    
LZMA. I had most of my stuff already archived with it. –  NightwishFan Oct 11 '10 at 4:28
1  
Actually after a bit of testing it seems like xz will be the way forward. It also saves quite a bit of compression (10mb somtimes) on binary stuff over lzma. –  NightwishFan Oct 13 '10 at 10:13
6  
That was not an appropriate answer, in regards to "OK using either". Even at the time when he posted this question, .lzma files were known to be replaced completely by .xz in the near future. The author of LZMA-Utils has said publicly, they were deprecated and use xz-utils from 5.00 onward. The last LZMA-Utils release was 2008-07-30, even at the time years old. So compression wise, the improvements might not be a huge determining factor. (ironically in case it was) But "political" reasons should have been a significant reason to use XZ-Utils, and avoid making new .lzma archives. –  TechZilla Jan 22 '12 at 11:17

I disagree with @dv3500ea's conclusion, "OK using either", as it was inappropriate. Even at the posted date/time, .lzma files were known to be replaced completely by .xz. The author of both Utils has said publicly, users should transition to XZ-Utils ≥ 5.00. The last LZMA-Utils release was 2008-07-30, at posted date/time years old.

The determining factor might not be compression, although ironically it was for this example. "practical reasons" are a self-evident, and significant, reason to use XZ-Utils. Additionally the .xz format allows you to specify compression algorithms, and filters, so .xz files can use either LZMA or LZMA2. Avoid creating new .lzma files, they are considered a legacy format.

As for even keeping LZMA-Utils around, don't, XZ-Utils has support for legacy .lzma files. It also has wrappers for scripts still using LZMA-Utils. If all those reasons were still insufficient, Ubuntu dropped legacy lzma-utils from its repository.

share|improve this answer
    
"The author of both Utils has said publicly, users should transition to XZ-Utils ≥ 5.00." Citation needed. :-) –  Faheem Mitha Feb 13 at 23:48
    
@FaheemMitha: Since this is a post, and not an educational reference or original research, the citation would only be the project page. I assumed since it was from the LZMA-Utils author, and he wrote BOTH utility sets with intention of xz-utils replacing legacy LZMA-Utils, it was self-evident. ...But For anyone who want's to get more details, tukaani.org/lzma. –  TechZilla Oct 3 at 17:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.