Translate

Archives

Image of XSLT 2.0 and XPath 2.0 Programmer's Reference (Programmer to Programmer)
Image of Modern Operating Systems (3rd Edition)
Image of Beginning Google Maps API 3
Image of Advanced Programming in the UNIX Environment, Second Edition (Addison-Wesley Professional Computing Series)

List or Count Installed RPM Packages

If you are on a RPM-based Linux platform (such as Redhat, CentOS, Fedora, ArchLinux, Scientific Linux, etc.), here are two ways to determine the list of packages installed.

Using yum:

yum list installed


Using rpm:

rpm -qa


You can also easily get a count of the installed packages by piping the output to wc:

yum list installed  | wc -l


rpm -qa | wc -l

2 comments to List or Count Installed RPM Packages

  • Feriaman

    Hello,

    yum list installed | wc -l

    doesn’t always work as the output of yum list installed is pretty printed. One package may be printed on multiple lines if needed.

  • Bruno

    @Feriaman

    You’re right, that’s why i get different package count from yum and rpm:

    [root@centos7 ~]# yum list installed | wc -l
    294
    [root@centos7 ~]# rpm -qa | wc -l
    292