Adding Package Architecture to an RPM Package Listing

rpm -q by default doesn’t show the architecture of the packages, which can result in annoying things like this:

# rpm -q glibc
glibc-2.5-81
glibc-2.5-81

To fix this, use the --qf "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n" option.

# rpm -q --qf "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n" glibc
glibc-2.5-81.x86_64
glibc-2.5-81.i686