Loading...

Lab 119: YUM Basics

Use yum to verify repositories, discover packages, identify file ownership, review transaction history, and perform safe repair workflows. Practice the commands you use on RHEL-family systems when you need evidence first and changes second.

packages troubleshooting rhel

Scenario

You are onboarding to a RHEL-like system where you must use yum to verify repositories, discover packages, identify which package owns a specific file, review transaction history, and perform safe package management actions. Your goal is to complete common workflows you will use when troubleshooting real servers.

Operator context

Treat yum as an evidence tool as much as an installer. Confirm repos and metadata first, then make targeted changes only after you can explain what will happen and why.

Objective

  • List enabled repositories and confirm the system’s repo set.
  • List installed packages using a name or pattern match.
  • Search for packages by keyword to discover candidates.
  • Inspect package details using yum info.
  • Identify which package provides a file path using yum provides / yum whatprovides.
  • Check for available updates without installing them.
  • Review transaction history to understand change provenance.
  • Reinstall a package as a repair workflow.
  • Clean metadata and re-verify repo visibility.

Concepts

  • Your repo configuration is your supply chain. If repos are missing or stale, your package results will be misleading.
  • Discovery is a workflow: search to find candidates, info to validate, then act.
  • “What owns this file?” is a core troubleshooting path: yum provides lets you tie a symptom on disk to the package you can repair.
  • yum history gives provenance: what changed, when, and which transaction likely caused a regression.
  • Use reinstall as a targeted baseline restore when you already know the owning package.

Walkthrough

Step 1 : List enabled repositories.
Command
yum repolist

Repos are your supply chain. If a repo is missing, disabled, or stale, package discovery results will be misleading.

repo id                               repo name
appstream                             Rocky Linux 9 - AppStream
baseos                                Rocky Linux 9 - BaseOS
extras                                Rocky Linux 9 - Extras
Step 2 : Confirm whether bash is installed.
Command
yum list installed bash

This confirms a package is installed and shows where it came from. For broader matches, use wildcards like '*bash*'.

Installed Packages
bash.x86_64                          5.1.8-6.el9                      @baseos
Step 3 : Search for packages related to “http server”.
Command
yum search http server

Use yum search to discover candidates quickly. It matches package names and summaries.

==================== Name & Summary Matched: http =====================
httpd.x86_64 : Apache HTTP Server
mod_ssl.x86_64 : SSL/TLS module for the Apache HTTP Server
Step 4 : Inspect package metadata for httpd.
Command
yum info httpd

This shows version, release, repo source, and summary. You typically check this before installing or debugging dependencies.

Available Packages
Name        : httpd
Version     : 2.4.57
Release     : 8.el9
Arch        : x86_64
Repo        : appstream
Summary     : Apache HTTP Server
Step 5 : Identify which package provides /usr/bin/top.
Command
yum provides /usr/bin/top

This is a core admin workflow: map a file on disk to the owning package so you can choose a targeted repair action.

procps-ng-3.3.17-13.el9.x86_64 : System and process monitoring utilities
Repo        : baseos
Matched from:
Filename    : /usr/bin/top
Step 6 : Check for updates without installing.
Command
yum check-update

This is your non-invasive “what would change” view. It’s useful for planning maintenance windows and spotting security-relevant updates.

curl.x86_64                         7.76.1-26.el9_4                 baseos
openssl-libs.x86_64                 3.0.7-25.el9_4                  baseos
Step 7 : Review transaction history.
Command
yum history

History answers “what changed and when.” It’s critical when debugging regressions after updates or reconstructing actions during an incident.

ID     | Command line             | Date and time    | Action(s) | Altered
12     | install vim-enhanced     | 2026-01-02 12:20 | Install   |    1
11     | update                   | 2026-01-01 09:10 | Update    |   14
Step 8 : Reinstall bash as a repair workflow.
Repair note

Reinstall is a safe, targeted repair when you know the owning package and suspect file loss or corruption.

Command
sudo yum reinstall -y bash

This restores packaged files from repos while respecting config handling rules.

Dependencies resolved.
Reinstalling:
  bash.x86_64  5.1.8-6.el9  baseos
Complete!
Step 9 : Clean cached metadata.
Command
yum clean metadata

Use this when you suspect stale or broken metadata. It forces a fresh metadata fetch on the next operation.

0 files removed
Step 10 : Confirm enabled repos again.
Command
yum repolist

Quick verification that your repo view is still sane after cleanup and package operations.

repo id                               repo name
appstream                             Rocky Linux 9 - AppStream
baseos                                Rocky Linux 9 - BaseOS
extras                                Rocky Linux 9 - Extras

Common breakpoints

repolist is empty or missing expected repos

If repos are missing or disabled, discovery and installs will fail or look incomplete. Fix repo configuration first, then re-run yum repolist.

yum provides returns no matches

Ensure you are using the full path and that repos/metadata are available. If the file is local and not packaged, there may not be an owning RPM.

yum check-update output changes across runs

That can be normal as mirrors update. Treat it as a snapshot and re-check close to your maintenance window.

Cleanup checklist

Confirm repos are visible and that your package tooling is in a healthy state.

Commands
yum repolist
yum history | head -n 15
yum clean metadata
Success signal

Repos are listed, history is available, and metadata cleanup completes without errors.

Reference

  • yum repolist : Lists enabled repositories.
    • enabled : Show enabled repos explicitly.
  • yum list installed <name> : Show installed packages matching a name or pattern.
  • yum search <terms> : Search package names and summaries for keywords.
  • yum info <pkg> : Display package metadata (version, release, repo, summary).
  • yum provides <path> : Find which package provides a specific file path.
    • whatprovides : Alias for provides (same intent).
  • yum check-update : List available updates without installing.
  • yum history : Show transaction history and change provenance.
  • yum reinstall <pkg> : Reinstall a package to restore packaged files.
  • yum clean : Remove cached data to force fresh repo information.
    • metadata : Remove repo metadata only.
    • all : Remove metadata and cached packages.