Unpacking RPM Packages

Typically, you can do everything you need to manipulate RPM packages using the rpm command, but it is sometimes useful to know that you can convert an RPM package to a cpio archive as follows:

[email protected]:~/temp> rpm2cpio partimage-0.6.2-152.i586.rpm >partimage.cpio

You can then unpack the archive under the current directory with:

[email protected]:~/temp> cpio -ivd < partimage.cpio

Here again, the i option unpacks the archive, while the d option creates the necessary directories as cpio verbosely (v) operates on the archive. You will find directories under the current directory corresponding to the system locations where rpm will install the particular files. This corresponds to what you see if you look inside the rpm package with mc, for example.

Was this article helpful?

0 0

Post a comment