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.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
2.2 View Repository Details
Add-v for verbose details, including each repo’s URL and configuration file:
- 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, installyum-utils:
4. Adding a Custom Repository
To add a third-party or local repo:.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, useyum search. Single terms match any, quotes require both terms.
7. Viewing Package Information
Inspect a package before installation:8. Installing, Reinstalling, and Removing Packages
Install a new package: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:11. Updating and Upgrading Packages
Check for available updates:If a kernel or critical component is updated, reboot to ensure changes take effect: