- 8.2.2. Listing Packages
- 3 Ways to List All Installed Packages in RHEL, CentOS and Fedora
- 1. Using RPM Package Manager
- 2. Using YUM Package Manager
- 3. Using YUM-Utils
- Related Posts
- 3 thoughts on “3 Ways to List All Installed Packages in RHEL, CentOS and Fedora”
- How to list installed packages on RHEL 8 / CentOS 8 Linux
- Software Requirements and Conventions Used
- Using yum and dnf
- Use the repoquery command
- List installed packages using the rpm command
- And finally – the GUI
- Related Linux Tutorials:
- Yum, шпаргалка
- Оглавление
- Опции Yum
- Cледующие команды доступны после установки пакета yum-utils
- Конфигурационные файлы Yum и их расположение
- Некоторые опции yum.conf:
- Некоторые полезные плагины
- Работа Yum через прокси сервер
8.2.2. Listing Packages
All of Yum’s list commands allow you to filter the results by appending one or more glob expressions as arguments. Glob expressions are normal strings of characters which contain one or more of the wildcard characters * (which expands to match any character multiple times) and ? (which expands to match any one character).
Be careful to escape the glob expressions when passing them as arguments to a yum command, otherwise the Bash shell will interpret these expressions as pathname expansions, and potentially pass all files in the current directory that match the globs to yum . To make sure the glob expressions are passed to yum as intended, either:
Example 8.3. Listing all ABRT add-ons and plug-ins using glob expressions
Packages with various ABRT add-ons and plug-ins either begin with “ abrt-addon- ” , or “ abrt-plugin- ” . To list these packages, type the following at a shell prompt:
~]# yum list abrt-addon\* abrt-plugin\*
Loaded plugins: product-id, refresh-packagekit, subscription-manager Updating Red Hat repositories. INFO:rhsm-app.repolib:repos updated: 0 Installed Packages abrt-addon-ccpp.x86_64 1.0.7-5.el6 @rhel abrt-addon-kerneloops.x86_64 1.0.7-5.el6 @rhel abrt-addon-python.x86_64 1.0.7-5.el6 @rhel abrt-plugin-bugzilla.x86_64 1.0.7-5.el6 @rhel abrt-plugin-logger.x86_64 1.0.7-5.el6 @rhel abrt-plugin-sosreport.x86_64 1.0.7-5.el6 @rhel abrt-plugin-ticketuploader.x86_64 1.0.7-5.el6 @rhel
Lists all packages installed on your system. The rightmost column in the output lists the repository from which the package was retrieved.
Example 8.4. Listing installed packages using a double-quoted glob expression
To list all installed packages that begin with “ krb ” followed by exactly one character and a hyphen, type:
~]# yum list installed "krb?-*"
Loaded plugins: product-id, refresh-packagekit, subscription-manager Updating Red Hat repositories. INFO:rhsm-app.repolib:repos updated: 0 Installed Packages krb5-libs.x86_64 1.8.1-3.el6 @rhel krb5-workstation.x86_64 1.8.1-3.el6 @rhel
Example 8.5. Listing available packages using a single glob expression with escaped wildcard characters
To list all available packages with names that contain “ gstreamer ” and then “ plugin ” , run the following command:
~]# yum list available gstreamer\*plugin\*
Loaded plugins: product-id, refresh-packagekit, subscription-manager Updating Red Hat repositories. INFO:rhsm-app.repolib:repos updated: 0 Available Packages gstreamer-plugins-bad-free.i686 0.10.17-4.el6 rhel gstreamer-plugins-base.i686 0.10.26-1.el6 rhel gstreamer-plugins-base-devel.i686 0.10.26-1.el6 rhel gstreamer-plugins-base-devel.x86_64 0.10.26-1.el6 rhel gstreamer-plugins-good.i686 0.10.18-1.el6 rhel
3 Ways to List All Installed Packages in RHEL, CentOS and Fedora
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:
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:
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:
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:
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.
Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.
Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.
Related Posts
3 thoughts on “3 Ways to List All Installed Packages in RHEL, CentOS and Fedora”
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. Reply
Hi. For Fedora, as output, the number (not the list) of all packages (available and installed) regarding a specific added repository . Regards. Reply
@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:
# yum list installed | wc -l OR # rpm -qa | wc -l
How to list installed packages on RHEL 8 / CentOS 8 Linux
There might come a time when you want to know if you have already installed a certain package on your RHEL 8 / CentOS 8. An application to be manually installed might require certain dependencies to work so you’ll have to check beforehand if these are satisfied. Or you might want to compile something and want to make sure you have all the right header libraries on your system.
In this tutorial you will learn:
- How to use yum and dnf in RHEL 8 / CentOS 8 to list all packages
- How to use the repoquery command to accomplish the same task
- How to use the rpm command to list all packages installed on RHEL 8 / CentOS 8
- How to filter the output of each command to seek certain packages
Software Requirements and Conventions Used
Category | Requirements, Conventions or Software Version Used |
---|---|
System | RHEL 8 / CentOS 8 |
Software | N/A |
Other | Privileged access to your Linux system as root or via the sudo command. |
Conventions | # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command $ – requires given linux commands to be executed as a regular non-privileged user |
Using yum and dnf
One way to check what you have installed using yum or dnf and the RHEL 8 / CentOS 8 repositories is to use
$ dnf list installed OR $ yum list installed
This will list all installed packages in alphabetical order. You can pipe the output to grep if you are looking for something in particular, say anything related to the bzip2 package:
$ dnf list installed | grep bzip2
As you can see in the image below, the command lists both the bzip2 binary package and the bzip2 library package. You even get the version number of the software so, if you might need an earlier version installed, you’ll know when to downgrade. The dnf command works exactly the same way as yum , with the same attributes, so you can use that if you fancy it.
Use the repoquery command
Another way to list available packages is to use dnf-utils . The package set is used to manage repositories and one of its functions is the ability to list installed packages. Make sure you installed dnf-utils with
# dnf install dnf-utils
then use the repoquery command that comes with dnf-utils to list all installed packages:
$ repoquery -a --installed
Same as with the piped grep above, we can also use grep here to filter what we are interested in:
$ repoquery -a --installed | grep bzip2
List installed packages using the rpm command
A third way to list installed packages is to use the rpm command and make it do a query for all installed packages:
If you want to look for all packages pertaining to bzip2 use
And finally – the GUI
If you want to use a graphical user interface, the Software package management application offers a tab listing all installed applications. The downside being that it only lists the names of the applications and not their package names; dependencies are also not shown and the overall information provided is limited.
Related Linux Tutorials:
Yum, шпаргалка
Шпаргалка по работе с пакетным менеджером Yum (Yellowdog Updater, Modified), который используется в популярных Linux дистрибутивах: RedHat, CentOS, Scientific Linux (и других). В целях экономии места вывод команд не представлен.
Оглавление
#yum updateinfo list security
#yum groupinfo "Basic Web Server"
#yum groupinstall "Basic Web Server"
#yum groupremove "Basic Web Server"
#yum repo-pkgs reponame install
#yum repo-pkgs reponame remove
проверить локальную базу rpm (поддерживаются параметры dependencies, duplicates, obsoletes, provides)
установить из локальной директории (поиск/установка зависимостей будут произведены из подключенных репозиториев)
#yum localinstall httpd.rpm
#yum localinstall http://server/repo/httpd.rpm
Опции Yum
--disableplugin=fastestmirror
#yum update -y --enablerepo=epel
#yum update -y --disablerepo=epel
скачать пакеты, но не устанавливать
(на Centos 7 x86_64 будут скачаны в ‘/var/cache/yum/x86_64/7/base/packages/’)
#yum install httpd --downloadonly
Cледующие команды доступны после установки пакета yum-utils
#repoquery --requires --resolve httpd
#reposync -p repo1 --repoid=updates
запрос к локальной базе yum, отображение информации о пакете
(использованная команда, контрольная сумма, URL с которого был установлен и другое)
скачать src.rpm пакет из репозитория
(должен быть подключен соответствующий репозиторий, например в ‘/etc/yum.repos.d/CentOS-Sources.repo’ в CentOS)
Конфигурационные файлы Yum и их расположение
Некоторые опции yum.conf:
cachedir=/var/cache/yum/$basearch/$releasever
Определяет должен или нет Yum хранить кэш заголовков и пакетов после успешной установки. Значения: 0 или 1. (по умолчанию 1)
Некоторые полезные плагины
Работа Yum через прокси сервер
proxy_proxy_username=user proxy_password=pass
#export http_proxy="http://server:3128"