Linux rpm list installed package

by on August 30, 2007 · 11 comments· last updated at August 30, 2007

Q. How do I list all installed packages using rpm under Linux?

A. rpm is a powerful Package Manager, which can be used to build, install, query, verify, update, and erase individual software packages.

rpm has -a option to query (list) all installed packages.

List all installed packages using rpm -a option

Type the command as follows:
# rpm -qa
Output:

filesystem-2.4.0-1
comps-extras-11.1-1.1
gnome-mime-data-2.4.2-3.1
glibc-2.5-12
atk-1.12.2-1.fc6
libICE-1.0.1-2.1
db4-4.3.29-9.fc6
elfutils-libelf-0.125-3.el5
ncurses-5.5-24.20060715
libsepol-1.15.2-1.el5
libcap-1.10-26
sqlite-3.3.6-2
pcre-6.6-1.1
gdbm-1.8.0-26.2.1
libsepol-1.15.2-1.el5
libXdmcp-1.0.1-2.1
db4-4.3.29-9.fc6
iptables-1.3.5-1.2.1
libXrender-0.9.1-3.1
libXi-1.0.1-3.1
xorg-x11-font-utils-7.1-2
slang-2.0.6-4.el
.....
..
....

You can display more information about package using following command:
# rpm -qi iptables
Output:

Name        : iptables                     Relocations: /usr
Version     : 1.3.5                             Vendor: Red Hat, Inc.
Release     : 1.2.1                         Build Date: Thu 13 Jul 2006 07:17:24 PM CDT
Install Date: Tue 10 Jul 2007 08:49:20 AM CDT      Build Host: ls20-bc2-14.build.redhat.com
Group       : System Environment/Base       Source RPM: iptables-1.3.5-1.2.1.src.rpm
Size        : 676805                           License: GPL
Signature   : DSA/SHA1, Thu 18 Jan 2007 09:47:22 AM CST, Key ID 5326810137017186
Packager    : Red Hat, Inc. 
URL         : http://www.netfilter.org/
Summary     : Tools for managing Linux kernel packet filtering capabilities.
Description :
The iptables utility controls the network packet filtering code in the
Linux kernel. If you need to set up firewalls and/or IP masquerading,
you should install this package.

You can list package file using following command:
# rpm -ql iptables
Output:

/etc/rc.d/init.d/iptables
/etc/sysconfig/iptables-config
/lib64/iptables
/lib64/iptables/libipt_CLASSIFY.so
/lib64/iptables/libipt_CONNMARK.so
/lib64/iptables/libipt_DNAT.so
/lib64/iptables/libipt_DSCP.so
/lib64/iptables/libipt_ECN.so
.....
.......
...


You should follow me on twitter here or grab rss feed to keep track of new changes.

Featured Articles:

{ 11 comments… read them below or add one }

1 gm February 13, 2009 at 5:30 am

Thanks a lot.

simple and beautiful

Reply

2 fsw September 18, 2009 at 8:31 pm

Merci beaucoup, I was just searching for that option right now!

And if one has a lot of .rpm, it’s great to pipe it through sort and more, like this:

rpm -qa | sort -fu | more

then you got a nice alphabetical list that you don’t need to scroll up and down…

Greetings from France

Reply

3 chetan May 16, 2011 at 6:21 am

thanks a lot …………….

Reply

4 shashwat singh February 26, 2010 at 8:16 am

hey ol of u’ve written how to list the installed packages, but is there a way to install a new package using rpm???????
please help me out!!!!!!!!!!

Reply

5 aries sulit November 21, 2010 at 1:34 am

hi! is it possible to check if my packages are really installed using rpm? thanks in advance!

Reply

6 Andrew November 6, 2011 at 10:28 am

Hi! ,
By using these commands I can’t find package which I have installed by other way, par exemple: with ‘make install’.

Reply

7 eric February 3, 2012 at 5:25 pm

Unless you have compiled your own rpm or installed an rpm, you will not see custom built packages in your rpm list.

Reply

8 Den March 21, 2012 at 5:50 am

Is there a way to list the packages name only without the version number?

Reply

9 Den March 21, 2012 at 5:50 am

Is there a way to list packages without the version number?

Reply

10 Jan April 20, 2012 at 8:51 am

rpm -qa –queryformat “%{NAME}\n”

Reply

11 KMP September 24, 2012 at 4:05 pm

formatting problem above
rpm -qa –queryformat “%{NAME}\n”
note two hypen characters

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <kbd> <blockquote> <pre> <a href="" title="">

Tagged as: , , , , ,

Previous Faq:

Next Faq: