Linux: How to list installed RPM packages
Introduction
In this quick guide, we'll see how to list installed RPM packages in a Red Hat based Linux distribution (Fedora, CentOS, Red Hat Enterprise Linux -RHEL-, and so on) or any other distribution that uses the RPM package manager.
I will be using the rpm
command-line tool for this purpose.
You can check the official documentation and the specific rpm man page for more information.
Listing installed RPM packages
To list all the installed RPM packages in your system, you can use the -a
or --all
option:
rpm -qa
This will output a list of every installed package in your system.
You can narrow down the list by providing a package name or a pattern to match the package names.
For example, to list all the packages that contain the word curl
in their name:
rpm -qa "*curl*"
This will output a list of every installed package that contains the word curl
in its name.
Getting information about a specific package
Once you have the list of installed packages, you can get more detailed information about a specific package using the -qi
or --query --info
option:
rpm -qi <package-name>
For example, let's get the information for curl-8.0.1-6.fc38.x86_64
:
rpm -qi curl-8.0.1-6.fc38.x86_64
The output will show the complete information about the package, including the version, release, architecture, installation date, and more.
Name : curl
Version : 8.0.1
Release : 6.fc38
Architecture: x86_64
Install Date: Mon 08 Jan 2024 09:48:24 AM CET
Group : Unspecified
Size : 787160
License : MIT
Signature : RSA/SHA256, Thu 07 Dec 2023 12:34:25 PM CET, Key ID 809a8d7ceb10b464
Source RPM : curl-8.0.1-6.fc38.src.rpm
Build Date : Thu 07 Dec 2023 09:57:31 AM CET
Build Host : buildvm-x86-26.iad2.fedoraproject.org
Packager : Fedora Project
Vendor : Fedora Project
URL : https://curl.se/
Bug URL : https://bugz.fedoraproject.org/curl
Summary : A utility for getting files from remote servers (FTP, HTTP, and others)
Description :
curl is a command line tool for transferring data with URL syntax, supporting
FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS, FILE, IMAP,
SMTP, POP3 and RTSP. curl supports SSL certificates, HTTP POST, HTTP PUT, FTP
uploading, HTTP form based upload, proxies, cookies, user+password
authentication (Basic, Digest, NTLM, Negotiate, kerberos...), file transfer
resume, proxy tunneling and a busload of other useful tricks.
Conclusion
In this quick guide, we've learned how to list installed RPM packages in a Red Hat based Linux distribution. We've also seen how to get detailed information about a specific package. You should now be able to use this information to manage your installed packages more effectively.