[Centos] Change your default rpm query format on multi-lib archs (like x86_64)

http://grokbase.com/t/centos.org/centos/2005/01/centos-change-your-default-rpm-query-format-on-multi-lib-archs-like-x86-64/1277ni5dyifjolxwsmqjhio6j7m4

All,

I am now building rpms on, and using a multi-lib arch (x86_64) for the
first time … when using the standard command:

rpm -qa | grep pkg_name

The results might be pkg_name.i386 or pkg_name.x86_64 … or both. But,
the way it is shown by the default query format, looks the same … like
this:

pkg_name
pkg_name
—————————-
example:

[root@x86-64 ~]# rpm -qa | grep popt

popt-1.9.1-21
popt-1.9.1-21
—————————-

To fix this problem on multi-lib machines (and change the default query
format), you can change your .rpmmacros (or create a .rpmmacros) in your
user home directory and add this line:

%_query_all_fmt %%{name}-%%{version}-%%{release}.%%{arch}

—————————
Now the result of the above example is:

[root@x86-64 ~]# rpm -qa | grep popt

popt-1.9.1-21.x86_64
popt-1.9.1-21.i386
—————————

So now you can easily tell which arch of a program is installed on
multi-lib machines.

Thanks,
Johnny Hughes

This entry was posted in Linux. Bookmark the permalink.

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>