Playing with RPMS!
A light hearted intro to play with RPM to extract some information
Posted on
I have been playing with RPM a lot lately. Do I like them ? Do I have fun while packaging stuff? Well in all honesty, nope, not at all, but I am learning new tricks to get more out of the RPM system.
Recently I have been involved with getting some information from specs files and also from the generated RPMS.
So, here, just for my own self, let me try to pen down a few tricks that i like to use with RPM.
Extract all the packages that are provided by a given RPM:
rpm -qp --qf '[%{N} \\n]' --nosignature some.rpm
The above command if broken down, if provided a --query-format/--qf
which return whatever you ask from the RPM. In the above command, my question is simple, what packages are provided by the given RPM, without the version/distro-tag/
or any other BS.
We could have asked the same question to a .spec
file as well
rpmspec -q --queryformat '[%{N} \\n]' some.spec
To get all possible values of what can be given in the --queryformat
, well, ask rpm/rpmspec
rpmspec --querytags
Most of the values there are self-explainatory!
Thats it for today!