One of the several duties of a system administrator is to install and manage software on a computer system-Linux in this case and in order keep track of installed/available software packages on your system, you can learn, and/or keep in mind a few quick commands.
In this article, we will explain how to list all installed rpm packages on CentOS, RHEL and Fedora distributions using four different ways.
1. Using RPM Package Manager
RPM (RPM Package Manager) formerly known as Red-Hat Package Manager is an open source, low-level package manager, which runs on Red Hat Enterprise Linux (RHEL) as well as other Linux such as CentOS, Fedora and UNIX systems.
You can compare it to DPKG Package Manager, the default packaging system for Debian and it’s derivatives such as Ubuntu, Kali Linux etc.
The following command will print a list of all installed packages on your Linux system, the flag -q
meaning query and -a
enables listing of all installed packages:
# rpm -qa
2. Using YUM Package Manager
YUM (Yellowdog Updater, Modified) is an interactive, front-end rpm based, package manager.
You can use the yum command below to list all installed packages on your system, one advantage with this method is, it includes the repository from which a package was installed:
# yum list installed
3. Using YUM-Utils
Yum-utils is an assortment of tools and programs for managing yum repositories, installing debug packages, source packages, extended information from repositories and administration.
To install it, run the command below as root, otherwise, use sudo command:
# yum update && yum install yum-utils
Once you have it installed, type the repoquery command below to list all installed packages on your system:
# repoquery -a --installed
To list installed packages from a particular repository, use the yumdb program in the form below:
# yumdb search from_repo base
Read more about package management in Linux:
- Linux Package Management with Yum, RPM, Apt, Dpkg, Aptitude and Zypper
- 5 Best Linux Package Managers for Linux Newbies
- 20 Useful ‘Yum’ Commands for Package Management
- 27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Fedora
In this article, we showed you how to list all installed packages on CentOS or RHEL four different ways. Share your thoughts concerning this article via the feedback section below.
Hi. Since the release of Fedora 22, in which DNF became the new default packaging tool and therefore obsoleted yum command on subsequent Fedora OSs, YUM was kept on those Fedora OSs for compatibility reason regarding Linux distributions forked from the Fedora project (Red Hat, Centos) that kept on using YUM, and will be kept for that very reason until they adopt it definitively.
I had little time before your previous post as reply, to test a command of my investigation that also relies as well on expression ‘wc -l‘ . Such command is likely to cover all current active repositories on a system which is indeed exactly what I was aiming to.
Here are for comparative purpose the following commands (by the way, there is no need to be executed as user root): ‘dnf list installed|wc -l‘, ‘rpm -qa|wc -l‘ respective outputs: 1619, 1590.
As noticeable those outputs are incorrect which is no surprise after investigation. Their subsequent commands are inappropriate; they do not reflect exclusively the current active repositories on my system, which in that case are fedora, updates which respectively contain 54 801, 13 085 packages (subsequent results are available from another command too). Good luck though in your hobby.
Hi. For Fedora, as output, the number (not the list) of all packages (available and installed) regarding a specific added repository . Regards.
@Ricky
You can pipe the output of the above commands to wc utility with the
-l
switch, to get the number instead of a list of installed packages, like this: