Unpacking an RPM

Unpacking an RPM is achieved by using the rpm2cpio and cpio commands in concert as shown below. This will unpackage the RPM into the current directory following a localised structure which would otherwise be where this package would be installed conventionally.

i.e. ./usr/bin/gmake rather than /usr/bin/gmake

For example, unpack the Make RPM downloaded above into a separate directory, substituting its filename if a different version was downloaded:

mkdir make-unpacked
cd make-unpacked
rpm2cpio ../make-4.3-8.el9.x86_64.rpm | cpio -idmv

This extracts files under the current directory; it does not install the package system-wide or resolve its dependencies.