Skip to content
Latchkey

ncompress: The .Z Package on Modern Linux

ncompress is the Linux package that ships the compress and uncompress binaries for the legacy .Z (LZW) format, absent from most default runner images.

When a pipeline hits an old .Z artifact and reports command not found, ncompress is the package you install. It is a thin wrapper around the same LZW tools, so this page is about getting them present.

What it does

The ncompress package provides compress and uncompress (and sometimes zcat for .Z) implementing the LZW algorithm behind the .Z extension. Installing it makes the compress/uncompress commands available; the flags are the same as classic compress.

Common usage

Terminal
apt-get install -y ncompress        # Debian/Ubuntu
apk add ncompress                   # Alpine
uncompress vendor.tar.Z             # now available
# fallback with no install:
gunzip -c vendor.tar.Z | tar -x

Options

ItemWhat it does
apt-get install ncompressProvides compress/uncompress on Debian/Ubuntu
apk add ncompressProvides them on Alpine
compress -d / uncompressDecompress a .Z file
gunzip -c / zcatRead .Z with no ncompress install

In CI

Prefer the fallback where you only need to read .Z: gunzip and zcat decode LZW without any extra package. Install ncompress only when a tool specifically shells out to compress or uncompress by name, or when you must write .Z.

Common errors in CI

"compress: command not found" is precisely what ncompress fixes. On Alpine, if apk add ncompress reports the package is missing, enable the community repository. If you only need decompression, avoid the install entirely with gunzip -c file.Z.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →