Skip to main content
Managing software on Red Hat Enterprise Linux (RHEL) relies on YUM (Yellowdog Updater, Modified) or its successor, dnf. In this guide, you’ll learn how to register your system, configure repositories, and install, update, or remove packages. Most yum commands work identically with dnf; just replace yum with dnf where desired.
If you prefer dnf over yum, you can use it interchangeably, for example:

1. Registering with Red Hat Subscription Management

Before accessing Red Hat repositories, register and attach your system to a subscription.
Once registered, attach the system automatically:
Ensure your subscription is active; expired subscriptions will prevent you from installing or updating packages.

2. Listing and Inspecting Repositories

A repository (repo) is a storage location—online or on your network—containing RPM packages, metadata, and signing keys.

2.1 View Enabled Repositories

Sample output:

2.2 View Repository Details

Add -v for verbose details, including each repo’s URL and configuration file:
Key fields in the output:
  • Repo-baseurl: URL where YUM fetches packages
  • Repo-filename: Local file under /etc/yum.repos.d/

3. Enabling and Disabling Repositories

Some packages reside in optional or specialized repos.

3.1 List All Repositories

3.2 Using Subscription Manager

Enable or disable by repo ID:

3.3 Using yum-config-manager

First, install yum-utils:
Then enable or disable:

4. Adding a Custom Repository

To add a third-party or local repo:
This creates a .repo file in /etc/yum.repos.d/. Verify it:

5. Understanding a .repo File

Open the Docker repo for inspection:
To completely remove a repository, delete its file:

6. Searching for Packages

If you’re unsure of the exact name, use yum search. Single terms match any, quotes require both terms.
Example result:

7. Viewing Package Information

Inspect a package before installation:
Sample output:

8. Installing, Reinstalling, and Removing Packages

Install a new package:
Reinstall (e.g., to restore missing config files):
Remove a package and its dependencies:
Clean up unneeded dependencies:

9. Managing Package Groups

YUM supports predefined groups (e.g., “Server with GUI”). Example:

10. Installing from a Local RPM File

After downloading an RPM:
Remove it when no longer needed:

11. Updating and Upgrading Packages

Check for available updates:
Apply all updates:
If a kernel or critical component is updated, reboot to ensure changes take effect:

Watch Video