RPM/yum : List (installed) packages versions (and grep ‘OR’)

Here’s how to list all packages whose names start with ‘nss’

yum info -v nss* | grep -v Committer | grep -w 'Name\|Version\|Release\|Description\|Repo'

Here’s how to list all INSTALLED packages whose names start with ‘nss’

yum info -v nss* | grep -A12 -B5 -w 'installed' | grep -v Committer | grep -w 'Name\|Version\|Release\|Description\|Repo\|installed'

And since the above is a bit hard to read you may also want to group the entries for each package and separate them by new lines. Here’s how to do this using ‘awk’:

yum info -v nss* | grep -A12 -B5 -w 'installed' | grep -v Committer | grep -w 'Name\|Version\|Release\|Description\|Repo\|installed' | awk '{if ($1 == "Description") print $0,"\n"; else print $0; }'

Leave a Reply

Your email address will not be published. Required fields are marked *