Menu Close

Chapter 4. Searching for RHEL 9 content

The following sections describe how to locate and examine content in the AppStream and BaseOS repositories in Red Hat Enterprise Linux 9:

4.1. Searching for software packages

This section describes steps needed for finding a package providing a particular application or other content.

Procedure

  • To search for a package, use:

    # dnf search term

    Replace term with a term related to the package.

    Note that the dnf search command returns term matches within the name and summary of the packages. This makes the search faster and you can search for packages you do not know the name of, but for which you know a related term.

  • To include term matches within package descriptions, use:

    # dnf search --all term

    Replace term with a term you want to search for in a package name, summary, or description.

    Note that the dnf search --all command enables a more exhaustive but slower search.

4.2. Listing software packages

The following procedure describes how to list available packages with dnf.

Procedure

  • To list information on all installed and available packages, use:

    # dnf list --all
  • To list all packages installed on your system, use:

    # dnf list --installed

    Alternatively:

    # dnf repoquery --installed
  • To list all packages in all enabled repositories that are available to install, use:

    # dnf list --available

    Alternatively:

    # dnf repoquery

Note that you can filter the results by appending global expressions as arguments. For more details, see Specifying global expressions in dnf input.

4.3. Listing repositories

The following procedure describes how to list repositories with dnf.

Procedure

  • To list all enabled repositories on your system, use:

    # dnf repolist
  • To list all disabled repositories on your system, use:

    # dnf repolist --disabled
  • To list both enabled and disabled repositories, use:

    # dnf repolist --all
  • To list additional information about the repositories, use:

    # dnf repoinfo

Note that you can filter the results by passing the ID or name of repositories as arguments or by appending global expressions. For more details, see Specifying global expressions in dnf input.

4.4. Displaying package information

The following procedure describes how to display package information using dnf.

Procedure

  • To display information about one or more available packages, use:

    # dnf info package-name

    Replace package-name with the name of the package.

    Alternatively:

    # dnf repoquery --info package-name

    Replace package-name with the name of the package.

  • To display information about one or more packages installed on your system, use:

    # dnf repoquery --info --installed package-name

    Replace package-name with the name of the package.

Note that you can filter the results by appending global expressions as arguments. For more details, see Specifying global expressions in dnf input.

4.5. Listing package groups

The following procedure describes how to list package groups using dnf.

  • To view the number of installed and available groups, use:

    # dnf group summary
  • To list all installed and available groups, use:

    # dnf group list

    Note that you can filter the results by appending command line options for the dnf group list command (--hidden, --available). For more available options see the man pages.

  • To list mandatory and optional packages contained in a particular group, use:

    # dnf group info group-name

    Replace group-name with the name of the group.

Note that you can filter the results by appending global expressions as arguments. For more details, see Specifying global expressions in dnf input.

4.6. Listing available modules

The following procedure describes how to find which modules are available and what their details are using dnf.

Procedure

  • To list module streams available to your system:

    # dnf module list

    The output of this command lists module streams with name, stream, profiles, and summary on a separate line.

    Note

    Modules will be available in future minor RHEL 9 releases.

Additional resources

4.7. Specifying global expressions in dnf input

With dnf commands, you can filter the results by appending one or more global expressions as arguments. Global expressions must be escaped when passed as arguments to the dnf command.

The following procedure describes two ways to ensure global expressions are passed to dnf as intended.

Procedure

  • Double-quote or single-quote the entire global expression:

    # dnf provides "*/file-name"

    Replace file-name with the name of the file.

    Note that the file-name must be preceeded either by / or */ character sequence to provide the desired outcome.

  • Escape the wildcard characters by preceding them with a backslash (\) character:

    # dnf provides \*/file-name

    Replace file-name with the name of the file.

4.8. Additional resources