From the command line, I would like to compress some database dumps using the LZMA algorithm. And, OSX adds XZ support (written in October of last year), claims

" It turns out the XZ support in OS X 10.10 is kind of broken. Single‐file XZ file streams like those created by XZ Utils, 7zip, and other popular compression utilities are entirely unsupported . Only XZ files containing a TAR archive are supported. OS X insist that there must be a TAR archive inside XZ files or it will choke on it. "

Is this true?

I can create a tar archive with LZMA compression as such:

$ tar cfJ dbDumps.tar.xz DbDumps

But, indeed OSX does not ship with an LZMA executable (as far as I understand). I learned in the Linux & Unix forum that I could use "Homebrew" or "MacPorts" to get an LZMA executable, but I've not done this yet because I want my Mac as stable as possible.

  • So, is there a way for me, from a command shell, to compress non-tar files using the LZMA algorithm without having to add custom apps from HomeBrew, MacPorts, etc.? (I cannot use a gui to perform the compression.)
  • There is an xz tool which will compress, and then replace, individual files. Using Homebrew or MacPorts won't affect the stability of your Mac. Both install utilities to separate folders and don't replace anything built-in. Like for instance if you install coreutils, to get GNU versions of commands like ls, they'll install prefixed with 'g', like 'gls', and you can decide which to use. Other commands might be named the same but in different folders, and you can modify your path and aliases to run one in particular.
    – empedocle
    Commented Jul 9, 2015 at 20:04

1 Answer 1


XZ support on macOS isn't broken, it's just restricted to tar. :-)

There is nothing to worry about using Homebrew though. Head over to brew.sh to get started and then run brew install xz to install the xz binary.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .