Menu Close

Appendix A. DNF commands list

This chapter lists DNF commands for listing, installing, and removing content in Red Hat Enterprise Linux 9.

A.1. Commands for listing content in RHEL 9

The following table lists the commonly used DNF commands for finding content and its details in RHEL 9:

CommandDescription

dnf search term

Search for a package using term related to the package

dnf repoquery package

Search available DNF repositories for a selected package

dnf list

List information on all installed and available packages

dnf list --installed

dnf repoquery --installed

List all packages installed on your system

dnf list --available

dnf repoquery

List all packages in all enabled repositories that are available to install

dnf repolist

List all enabled repositories on your system

dnf repolist --disabled

List all disabled repositories on your system

dnf repolist --all

List both enabled and disabled repositories

dnf repoinfo

List additional information about the repositories

dnf info package-name

dnf repoquery --info package_name

Display details of an available package

dnf repoquery --info --installed package_name

Display details of a package installed on your system

dnf module list

List modules and their current status

Note that if the package is available outside any modules, the output of this command is empty.

dnf group summary

View the number of installed and available groups

dnf group list

List all installed and available groups

dnf group info group-name

List mandatory and optional packages included in a particular group

A.2. Commands for installing content in RHEL 9

The following table lists the commonly used DNF commands for installing content in RHEL 9:

CommandDescription

dnf install package-name

Install a package.

If the package is provided by a module stream, dnf resolves the required module stream and enables it automatically while installing this package. This also happens recursively for all package dependencies. If more module streams satisfy the requirement, the default ones are used.

dnf install package-name-1 package-name-2

Install multiple packages and their dependencies simultaneously

dnf install package-name.arch

Specify the architecture of the package by appending it to the package name when installing packages on a multilib system (AMD64, Intel 64 machine)

dnf install /usr/sbin/binary-file

Install a binary using the path to the binary as an argument

dnf install /path/

Install a previously downloaded package from a local directory

dnf install package-url

Install a remote package using a package URL

Enable the module when you want to make the packages available to the system but do not currently want to install any of them.

Some modules might not define default streams. In such cases, you must explicitly specify the stream.

If the module defines a default stream, you can omit the stream and colon.

Note that running this command does not install any RPM packages.

Note that some modules do not define default streams.

Note that running this command also enables the specified stream.

dnf group install group-name

Install a package group by a group name

dnf group install groupID

Install a package group by the groupID

A.3. Commands for removing content in RHEL 9

The following table lists the commonly used DNF commands for removing content in RHEL 9:

CommandDescription

dnf remove package-name

Remove a particular package and all dependent packages

dnf remove package-name-1 package-name-2

Remove multiple packages and their unused dependencies simultaneously

dnf group remove group-name

Remove a package group by the group name

dnf group remove groupID

Remove a package group by the groupID

Note that running this command can remove critical packages from your system.

Note that running this command does not remove packages from the specified module.

Note that running this command does not remove packages from the specified module.