I recently realized that the RPM packages shifted from gzip-compression to xz-compression a few years ago. I need to check is the compression type of an RPM package that I have. I also need to check what compression type is considered by my system when it is trying to unpack an RPM file.

  • 1
    Since you're using oracle-linux you should have the script /usr/lib/rpm/rpm2cpio.sh - this script works out what type of compression is used and will decompress it. You can probably use that as the basis for checking the compression your rpm package uses. Commented Aug 31, 2016 at 19:31
  • How can I figure out the compression type with this?
    – Alchemist
    Commented Sep 1, 2016 at 10:29

3 Answers 3


Query the RPM with a custom format that includes the Payloadcompressor tag ("Payload compressor name") like this:

rpm -q --queryformat '%{PAYLOADCOMPRESSOR}\n' -p qt-4.8.7-67.fc36.x86_64.rpm

By the way other interesting tags are Payloadflags ("Payload compressor level") and Payloadformat ("Payload format (cpio)").


If you use rpm2cpio; you don't need to know the compression format. You can use rpm2cpio to unpack rpms like this:

rpm2cpio your.rpm | cpio -idmv

To address: Which compression formats are supported?

It's easy enough to see what's not supported, e.g. trying to install an RPM from Fedora 34 on RHEL 6:

$ rpm --install https://dl.fedoraproject.org/.../Packages/t/tzdata-2021a-1.fc34.noarch.rpm
error: Failed dependencies:
        rpmlib(PayloadIsZstd) <= 5.4.18-1 is needed by tzdata-2021a-1.fc34.noarch

Although this dependency is not explicitly exposed by rpm-libs in a way which can be queried by --whatprovides, we can infer the compression formats supported by rpm-libs.

### why do all compression formats have "z" in the name? It's the fashion.
$ rpm -q --requires rpm-libs | grep '^lib.*z'

Another way to track this would be the features changes for Fedora etc.:

You must log in to answer this question.

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