How to List Installed Packages With dnf

dnf is a package management tool used for RPM-based Linux distributions like Fedora, Red Hat, CentOS, AlmaLinux, Rocky Linux, and others. In this article, we will show the useful dnf commands that allow us to list installed packages.

Listing Installed Packages

Example 1. List all installed packages with dnf command:

$ dnf list installed

Example 2. To check the total number of installed packages, we can pipe the output to the wc command:

$ dnf list installed | wc -l

Listing the number of installed packages

Example 3. List recently added packages (packages installed within the past week):

$ dnf list recent

List Available Packages

Example 1. To see a list of all the packages that can be downloaded and installed on your system:

$ dnf list available

Warning: you will get thousands of lines of output.

Example 2. To list all of the installed and available packages for your system:

$ dnf list all

Search For a Package

Example 1. To search for a package, execute the following command:

$ dnf search package_name

Searching for a package

Example 2. To show information for a particular package:

$ dnf info package_name

Displaying information about a package

Listing Package Groups

Linux distributions will often group multiple packages together, so the user doesn’t need to install many separate packages and can simply install them all with one group.

Example 1. You can use the summary flag see the total number of installed package groups, and the total number available:

$ dnf groups summary

Listing the number of installed and available group packages

Example 2. To get a list of package groups that are installed and available for installation:

$ dnf group list

Listing installed and available group packages

Example 3. We can see more information about a certain package group. To show information of the package group Robotics:

$ dnf group info Robotics

Displaying information about a group package

Listing Repositories

Example 1. To list all the repositories:

$ dnf repolist all

Example 2. If you want to only list the enabled repositories:

$ dnf repolist

To check more information about the dnf package manager:

$ dnf help

Leave a Comment

Your email address will not be published. Required fields are marked *