How do you extract the files from an .rpm without installing it?
Pipe it through rpm2cpio package.rpm | cpio -idmv — this unpacks the package's payload into the current directory without installing anything, touching the RPM database, or running the package's scripts.
An .rpm is really two things glued together: metadata (name, version, dependencies, install scripts) plus a compressed cpio archive holding the actual files. rpm2cpio strips off the metadata and streams out just that inner cpio payload; cpio then extracts it.
rpm2cpio podman-4.0.0-6.el9.x86_64.rpm | cpio -idmv
# ./usr/bin/podman
# ./usr/share/man/man1/podman.1.gz
# ...files appear under ./usr/... in the current dir
The cpio flags:
-i— extract (copy in from the stream)-d— create leading directories as needed (without this, nested paths fail)-m— preserve the original modification times-v— verbose: list each file as it's written
Note the files land under a relative tree (./usr/bin/...), not at the real /usr/bin — nothing is installed system-wide.
Why bother? To pull a single file out of a package without installing it, to inspect what a package would place on disk, or to recover one clobbered binary on a system where you can't run a full install. Swap -idmv for -tv to just list the contents without extracting.
Go deeper:
cpio(1) man page — copy-in/copy-out modes and the
-i -d -m -v -tflags.