I have an rpm and I want to treat it like a tarball. I want to extract the contents into a directory so I can inspect the contents. I am familiar with the querying commands of an uninstalled package. I do not simply want a list of the contents of the rpm. i.e.
$ rpm -qpl foo.rpm
I want to inspect the contents of several files contained in the rpm. I do not want to install the rpm. I am also aware of the rpms ability to do additional modifictions in the %post sections, and how to check for those. i.e.
$ rpm -qp --scripts foo.rpm
However in this case that is of no concern to me.
In OpenSuse at least, the
unrpm
command comes with thebuild
package.In a suitable directory (because this is an archive bomb):
To debug / inspect your rpm I suggest to use redline which is a java program
Usage :
Download : https://github.com/craigwblake/redline/releases
You can simply do
tar -xvf <rpm file>
as well!Copy the .rpm file in a separate folder then run the following command $ yourfile.rpm | cpio -idmv
The powerful text-based file manager mc (Midnight Commander, vaguely reminding the Norton Commander of old DOS times) has the built-in capability of inspecting and unpacking .rpm and .rpms files, just "open" the .rpm(s) file within mc and select
CONTENTS.cpio
: for an rpm you get access to the install tree, for an rpms you get access to the .spec file and all the source packages.For Reference: the cpio arguments are
I found the answer over here: lontar's answer