How to Extract Contents of an RPM Package
To extract files from an RPM package, one can use the command:
rpm2cpio rpmfile.rpm | cpio -idmv
It does the following:
- first
rpm2cpio
command converts the rpm package to a cpio archive - then the
cpio
command:- unpacks the archive (option
-i
) - creates a full directory structure (option
-d
) - and preservers file modification times (option
-m
).
- unpacks the archive (option