Chapter 3. Searching for RHEL content
Search and examine content in the Red Hat Enterprise Linux (RHEL) 10 AppStream and BaseOS repositories by using the DNF tool. For example, you can identify specific packages or package groups to ensure you install the exact components required for your environment’s stability and security.
3.1. Searching for software packages Copy linkLink copied to clipboard!
Identify and locate the specific software for your Red Hat Enterprise Linux (RHEL) 10 system by searching for packages with the DNF tool. You can search by name or summary to ensure you find and install the correct components required for your environment.
Procedure
Depending on your scenario, use one of the following options to search the repository:
To search for a term in the name or summary of packages, enter:
$ dnf search <term>To search for a term in the name, summary, or description of packages, enter:
$ dnf search --all <term>Note that searching additionally in the description by using the
--alloption is slower than a normal search operation.To search for a package name and list the package name and its version in the output, enter:
$ dnf repoquery <package_name>To search for which package provides a file, specify the file name or the path to the file:
$ dnf provides <file_name>
3.2. Listing software packages Copy linkLink copied to clipboard!
List available or installed packages on your Red Hat Enterprise Linux (RHEL) 10 system by using the DNF tool. You can use this information to confirm current versions and identify ready-to-install content to ensure your environment stays consistent and up-to-date.
Procedure
List the latest versions of all available packages, including architectures, version numbers, and the repository they where installed from:
$ dnf list --all... postgresql.x86_64 16.4-1.el10 rhel-AppStream postgresql-contrib.x86_64 16.4-1.el10 rhel-AppStream postgresql-docs.x86_64 16.4-1.el10 rhel-AppStream postgresql-jdbc.noarch 42.7.1-6.el10 rhel-AppStream ...The
@sign in front of a repository indicates that the package in this line is currently installed.Alternatively, to display all available packages, including version numbers and architectures, enter:
$ dnf repoquery... postgresql-0:16.4-1.el10.x86_64 postgresql-contrib-0:16.4-1.el10.x86_64 postgresql-docs-0:16.4-1.el10.x86_64 postgresql-jdbc-0:42.7.1-6.el10.noarch postgresql-odbc-0:16.00.0000-4.el10.x86_64 ...Optionally, you can filter the output by using other options instead of
--all, for example:-
Use
--installedto list only installed packages. -
Use
--availableto list all available packages. -
Use
--upgradesto list packages for which newer versions are available.
-
Use
3.3. Displaying package information Copy linkLink copied to clipboard!
View detailed metadata for specific software in Red Hat Enterprise Linux (RHEL) 10 by displaying package information with the DNF tool. You can use this information to verify that a package meets your system requirements and security standards before installation.
You can display the following types of information related to the package:
- Version
- Release
- Architecture
- Package size
- Description
Procedure
Display information about one or more available packages:
$ dnf info <package_name>This command displays the information for the currently installed package and, if available, its newer versions that are in the repository. Alternatively, use the following command to display the information for all packages with the specified name in the repository:
$ dnf repoquery --info <package_name>
3.4. Listing package groups and packages they provide Copy linkLink copied to clipboard!
List available package groups and their contents for your Red Hat Enterprise Linux (RHEL) 10 system by using the DNF tool. You can list package groups to quickly verify and install all required tools for specialized environments.
Procedure
List both installed and available groups:
$ dnf group listNote that you can filter the results by appending the
--installedand--availableoption to thednf group listcommand. By using the--hiddenoption, you can display hidden groups in the output.List mandatory, optional, and default packages contained in a particular group:
$ dnf group info "<group_name>"Optional: View the number of installed and available groups:
$ dnf group summary
3.5. Listing repositories Copy linkLink copied to clipboard!
List enabled and disabled repositories on your Red Hat Enterprise Linux (RHEL) 10 system by using the DNF tool. You can review the repositories to identify available content and troubleshoot repository availability to ensure your environment can access the necessary software updates.
Procedure
List all enabled repositories on your system:
$ dnf repolistTo display only certain repositories, append one of the following options to the command:
-
Append
--disabledto list only disabled repositories. -
Append
--allto list both enabled and disabled repositories.
-
Append
Optional: List additional information about the repositories:
$ dnf repoinfo <repository_name>
3.6. Specifying glob expressions in DNF input Copy linkLink copied to clipboard!
Write more expressive DNF commands on your Red Hat Enterprise Linux (RHEL) 10 system by appending one or more glob expressions as arguments.
Many DNF commands accept glob expressions in place of package names, file paths, and other parameters. Glob expressions are strings of characters that contain one or more of the wildcard characters. By using glob expressions, you can efficiently search for large groups of related software and match paths without requiring exact matches for every item.
Procedure
Use one of the following methods if you use global expressions in
dnfcommands:Enclose the entire global expression in single or double quotation marks:
# dnf provides "*/<file_name>"Note that you must precede
<file_name>either by/for an absolute path or*/to use a wildcard if the full path is unknown.Escape the wildcard characters by preceding them with a backslash (
\) character:# dnf provides \*/<file_name>