RPM queries

packageAfter I read about bug 211941 which installs the wrong architecture kernel on the machine I wondered how you can query a package in a way that it shows you the architecture as well.

First of all, the solution is pretty easy:

rpm -q --queryformat '[%{name}-%{version}-%{release}.%{arch} \n]' kernel

But as you can see there are other possibilities hidden in this line – you can combine the arguments as you wish, and you can add more: with rpm --querytags|sort you get a complete (sorted) list of all possible values you can query. And as you can see you can also sort them a bit: \n gives you a new line and \t a tab space.

This is nothing new, by the way, but I never wrote it down to have a real overview.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s