Trying to understand RPM Query Format

Latest response

I'm trying to understand RPM Query Format, and I'm not able to get anything to return from these.

rpm -qa --qf '%{NAME} %{VENDOR}\n' | grep -v "Red Hat"

I think this RPM Query looks for and returns any third party packages.

rpm -qa --queryformat '%{name-%{version}-%{release} %{size}\n'

This is another one that I've run, however it doesn't return any results either.

Was wondering if someone could point me in the right direction and could give me some pointers on how to get better at this.

thanks

Responses

Your first rpm command: Is it possible that you do not have anything from outside Red Hat?

Your second rpm command: there is a missing } after the %{name .

Ok, so I got this to work on a server where I know that we have Third Party RPMs

[cmmiller@amedvma4aisr3200 ~]$ rpm -qa --qf '%{NAME} %{VENDOR}\n' | grep -v "Red Hat"
gpg-pubkey (none)
oracleasm-support Oracle Corporation
oracleasm-2.6.18-404.el5 Oracle Corporation
jdk1.8.0_25 Oracle Corporation
oracleasmlib Oracle Corporation
gpg-pubkey (none)

I also then ran the 2nd command successfully, had to pipe thru sort and uniq to cut it down and organize it.

thanks

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.