Instiq
Chapter 4 · Repositories and Package Management·v1.0.0·Updated 7/6/2026·~10 min

What's changed: Initial version (topic 1.04, subtopics 1.04.1–1.04.4)

4.3Package Management with yum

Key points

Learn repository-based package management on RHEL-family systems: install/update/remove/search with yum, finding the package that provides a file (provides), repository configuration (/etc/yum.repos.d/, /etc/yum.conf), and download-only fetching with yumdownloader.

On RPM-family distributions (RHEL, CentOS, AlmaLinux), yum plays apt's role (its successor dnf keeps compatible usage). Same job—fetch from repositories, manage with dependencies—so learn it as a mapping from apt.

4.3.1Core yum operations

  • Install with yum install httpd; remove with yum remove httpd; update with yum update (everything, or one package by name); search with yum search keyword; details with yum info pkg.
  • File → package lookup with yum provides /usr/sbin/httpd (covers uninstalled packages). List with yum list installed.
  • Repositories are defined by .repo files in /etc/yum.repos.d/ (one section per repo); global settings in /etc/yum.conf. Check enabled repos with yum repolist.
  • yumdownloader downloads rpm files without installing—for offline transfer or inspection.
Exam point

Staples: package providing a file = yum provides, repo definitions = .repo files in /etc/yum.repos.d/, download only = yumdownloader. The apt mapping is the favorite confusion: yum update upgrades packages, while apt update only refreshes the index.

Exams target the asymmetry with apt. apt splits "update = index, upgrade = packages" into two words, but yum's update means "upgrade packages"—index refresh happens automatically each run (explicitly: yum makecache). So "ran yum update" = "packages were upgraded"; reading it with apt intuition gets you the wrong answer. Repo management differs too: apt lists everything in one sources.list, while yum drops one .repo file per repository into /etc/yum.repos.d/, toggled by enabled=1/0. Adding a corporate mirror is just placing one .repo file. yumdownloader is the staple for distributing rpms to air-gapped servers or inspecting before installing; --resolve also fetches dependent rpms.

GoalDebian family (apt)RHEL family (yum)
Installapt installyum install
Upgrade packagesapt update → apt upgradeyum update (index auto)
File → packageapt-file searchyum provides
Repo definitions/etc/apt/sources.list/etc/yum.repos.d/*.repo
Warning

Trap: "yum update, like apt update, only refreshes the index" is wrong—yum update upgrades packages (the index refreshes automatically). Distribution mix-ups like "yum repos are defined in /etc/apt/sources.list" are classic distractors too (correct: /etc/yum.repos.d/).

yum operations, provides/yumdownloader, and per-repo .repo files.
yum update upgrades packages

4.3.2Section summary

  • yum update = upgrade packages (index auto-refreshes); install/remove/search/info/list installed
  • provides = file lookup, /etc/yum.repos.d/ = per-repo .repo files, yumdownloader = download only

Sign in to track progress — Log in.

Quick check

(just a quick review)

Q1. On a RHEL-family server, you want to find which package provides /usr/sbin/httpd. Which command?

Q2. You need rpm files to carry to an offline test server—download only, no install. Which command?

Q3. You want to add a repository for yum. Where do its definition files go?

Check your understandingPractice questions for Chapter 4: Repositories and Package Management

Keep track of your progress

The full study guide is free to read. Sign up free to practice with the question bank, track what you have read, review your mistakes, and highlight passages.