List RPMs by name, version and description

Latest response

Anyone know how to list rpms and list descriptions to all rpms? I know yum info provides a description, but how would i apply this to all rpms installed?

Tried:

yum info [package name]

yum list installed

Responses

Problem with listing out descriptions is that they're multi-line. So, while you could do something like:

rpm -qa --qf '#####\n# %{name}-%{version}-%{release}\n#####\n%{description}\n##########\n##########\n\n'

The output's not going to be exactly gorgeous.

Derek, that example Thomas Jones gave is wonderful, you could push that to a text file perhaps and tidy it up afterwards. Also examine http://ftp.rpm.org/max-rpm/s1-rpm-query-handy-queries.html and navigate around in that website.

Regards,

RJ

Right, Thomas and RJ gave wonderful options.

You could try out this as well:

To list out all installed packages name and descriptions:

#yum info installed|awk '/Description/,/Name/'

The only glitch with this is that for the first package it would skip out name. So, to get it I could do it like this:

#ALLRPMS=$(yum info installed);echo "${ALLRPMS}"|grep "Name" -m1 > /tmp/rpmpackages.data;echo "${ALLRPMS}"|awk '/Description/,/Name/' >> /tmp/rpmpackages.data

Later, cat the file /tmp/rpmpackages.data it should up a nice list of all installed package name and description. There could be other ways as well to get this done.

Close

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