20081117 list full name of rpm packages installed - plembo/onemoretech GitHub Wiki

title: List full name of rpm packages installed link: https://onemoretech.wordpress.com/2008/11/17/list-full-name-of-rpm-packages-installed/ author: lembobro description: post_id: 427 created: 2008/11/17 19:26:24 created_gmt: 2008/11/17 19:26:24 comment_status: open post_name: list-full-name-of-rpm-packages-installed status: publish post_type: post

List full name of rpm packages installed

Sometimes when checking on installed Red Hat packages it’s helpful to see the full package name, especially when you’re trying to distinguish between x86 and x86_64 versions. Here’s a handy one-liner for that:

rpm -q [PACKAGE_NAME] --qf "%{name}-%{version}-%{release} .%{arch}n"

What this will get you is something like this:

rpm -q glibc --qf "%{name}-%{version}-%{release}.%{arch}n" glibc-2.5-24.x86_64 glibc-2.5-24.i686

If you need to check a bunch of similarly named packages at one, you could use the -qa switch and combine with a pipe (” | “) to grep and get something like this:

rpm -qa --qf "%{name}-%{version}-%{release}.%{arch}n" | grep openldap openldap-devel-2.3.27-8.el5_2.4.i386 openldap-2.3.27-8.el5_2.4.x86_64 openldap-servers-2.3.27-8.el5_2.4.x86_64 openldap-clients-2.3.27-8.el5_2.4.x86_64 openldap-devel-2.3.27-8.el5_2.4.x86_64 openldap-2.3.27-8.el5_2.4.i386

The “n” after “arch” is needed because by default the output won’t include the linefeeds needed to display things neatly.

Copyright 2004-2019 Phil Lembo