Learn to inspect and extract files from RPM packages without installing them. 16.11.2025 | reading time: 2 min Curious what is inside an RPM without installing it? This short guide shows how to list and extract files from an RPM package on the command line so you can inspect binaries, configs and scripts safely. Hands-on extraction Do this now: list files with `rpm -qpl` and then extract with `rpm2cpio` piped to `cpio`; for example:```bash # list files inside rpm -qpl mypkg-1.2.3-1.x86_64.rpm /usr/bin/mypkg /etc/mypkg.conf /usr/share/doc/mypkg/README # extract contents rpm2cpio mypkg-1.2.3-1.x86_64.rpm | cpio -idmv ./usr ./usr/bin ./usr/bin/mypkg ./etc ./etc/mypkg.conf ```Try it in a throwaway directory and inspect the extracted files. Options and use cases Want metadata or scripts instead of full extraction? Use `rpm -qip package.rpm` for package info and `rpm -qp --scripts package.rpm` to show pre/post install scripts; preserve timestamps with `cpio -m`, run extraction as root to keep original owners, or use `fakeroot` when you need ownership metadata without root. Alternate extractors If `rpm2cpio` is unavailable, `bsdtar -xf package.rpm` or `7z x package.rpm` often extract the payload; `rpm --checksig package.rpm` verifies signatures; and `alien` can convert RPMs to other formats when you need cross-distro packages. Where to go from here Start practicing with a few RPMs from a distribution mirror, inspect scripts and configs, and combine listing and extraction in scripts to automate audits; keep digging into package internals and consider formalizing skills with certifications like CompTIA Linux+ or LPIC-1 and focused exam preparation at bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. utilities filesystem troubleshooting