Linux rpm List Installed Packages

by on August 30, 2007 · 12 comments· LAST UPDATED November 19, 2013

in , ,

How do I list all installed packages using rpm command on CentOS/Suse/Fedora/RHEL/Scientific and Red Hat Enterprise Linux?

The rpm command is a powerful Package Manager, which can be used to build, install, query, verify, update, and erase individual software packages. The latest version of Red hat and friends recommend using the yum command.
Tutorial details
DifficultyEasy (rss)
Root privilegesYes
Requirementsrpm
Estimated completion time2m

rpm command syntax

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

List all installed packages using rpm -a option

Open the Terminal or login to the remote server using ssh client. Type the following command as root user:
# rpm -qa
Sample outputs:

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 the following command:
# rpm -qi iptables
Sample outputs:

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 files using the following command:
# rpm -ql iptables
Sample outputs:

/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
.....
.......
...

Feel free to add pager such as less or more to display output one screen at a time:
# rpm -qa | less
# rpm -qa | more
# rpm -qa | grep 'something'
# rpm -ql iptables | more

See also
TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 12 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

12 avoc15082013 August 15, 2013 at 2:49 pm

number of rpm installed, (just to take a count)

[oc@150820134 ~]$ rpm -qa | wc -l
1613
[oc@150820134 ~]$

Reply

Leave a Comment

Tagged as: , , , , , ,

Previous Faq:

Next Faq: