rpm -qa and architecture info
Yong Huang
yong321 at yahoo.com
Sat Mar 27 02:34:35 UTC 2010
> > `rpm -qa' shows the package names (and versions and releases). This command
> >
> > rpm -qa --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n'
> >
> > shows that plus architecture. Is there a shorter command that does the same, i.e. shows name, version, release and arch? It's hard to remember and type that long line. I want something like
> >
> > rpm -qa [a simple option that shows arch IN ADDITION TO what the preceding option i.e. -qa shows]
>
> Hi Yong,
>
> What I often do is create a file called /etc/rpm/macros.query_all_fmt and
> add the following content:
>
> %_query_all_fmt %%{name}-%%{version}-%%{release}.%%{arch}
>
> This will automatically show the architecture in a way that is compatible
> with yum if you do rpm -qa.
>
> This, however, will break any programs that does not specifically
> provide a query format and somehow expects the default output (without
> architecture).
>
> To be honest, I think the current default is a design bug. Not specifying
> an architecture results in non-unique output and causes confusion with
> users.
>
> --
> -- dag wieers, dag at wieers.com, http://dag.wieers.com/ --
> [Any errors in spelling, tact or fact are transmission errors]
Dag,
Thank you very much! You're the only person that understands my question. (To others, thank you all too, but you all missed my point.)
I tried your /etc/rpm/macros.query_all_fmt. It works great. Can you give an example of a program "that does not specifically provide a query format" and fails after this file is created? And I agree with you on the "design bug" comment on the current default.
Yong Huang
More information about the redhat-list
mailing list