Lists architecture of installed RPMs

rpm -qa --queryformat "%{NAME} %{ARCH}\n"
Lists all installed RPM packages with name and architecture, which is useful to check for compability packages (+ required i386 packages) on a 64bit system.
Sample Output
sgml-skel noarch
update-alternatives noarch
desktop-file-utils x86_64
db-devel x86_64

2
By: angrox
2009-03-18 15:19:21
rpm

These Might Interest You

  • Low on disk space? Check the largest installed RPMs for delete canditates. Show Sample Output


    2
    rpm -qa --qf '%{SIZE} %{NAME}\n' | sort -nr | nl | head -6 # six largest RPMs
    mpb · 2009-03-15 22:18:17 0
  • Find out which RPMs were installed on a particular date. These would (naturally) include update RPMs. This example shows searching for "Thu 05 Mar" (with grep). Alternatively, pipe it to less so you can search inside less (with less's neat text highlighting of the search term): rpm -qa --queryformat '%{installtime} \"%{vendor}\" %{name}-%{version}-%{release} %{installtime:date}\n' | less # (this example) search term: Thu 05 Mar Show Sample Output


    4
    rpm -qa --queryformat '%{installtime} \"%{vendor}\" %{name}-%{version}-%{release} %{installtime:date}\n' | grep "Thu 05 Mar"
    mpb · 2009-03-17 13:38:20 1
  • Interesting to see which packages are larger than the kernel package. Useful to understand which RPMs might be candidates to remove if drive space is restricted. Show Sample Output


    1
    rpm -qa --queryformat '%{size} %{name}-%{version}-%{release}\n' | sort -k 1,1 -rn | nl | head -16
    mpb · 2013-03-19 21:10:54 0
  • The queryformat option can be used in a number of ways to find things like duplicate packages, wrong arch, or the exact package to pass to rpm -e, yum remove, etc. Show Sample Output


    0
    rpm -qa --qf '%{name}-%{version}-%{release}.%{arch}\n'
    llama · 2009-03-24 20:42:17 0

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: