Emergency Extraction: When RPM Bites the Dust
Luke Hebert
- One minute read - 132 wordsNeed to peek inside an RPM package without installing it? rpm2cpio converts the package into a cpio archive, and cpio extracts the files into your current directory. This is handy for inspecting configuration files, scripts, or binaries before committing to a full install.
Usage
rpm2cpio myrpmfile.rpm | cpio -idmv-itells cpio to extract (in) the archive.-dcreates directories as needed.-mpreserves modification times.-vprints each file as it is extracted.
Tips
- Run the command from the directory where you want the extracted files to land.
- If you only need to list the contents without extracting, swap
-idmvfor-t:
rpm2cpio myrpmfile.rpm | cpio -t- On systems where
rpm2cpiois not installed by default, it typically ships in therpmorrpm-toolspackage depending on your distribution.