Loading...

Lab 71: System Updates and Repos

Validate repo visibility and run safe update workflows across RPM, Debian, and Arch families using repeatable commands. Inspect package metadata before install, apply updates predictably, and confirm repository state when installs fail.

packages updates repos

Scenario

You support a mixed fleet and need a standard way to confirm repository visibility, inspect package metadata before installation, and apply updates safely. Your task is to read RPM metadata from a file, install a package on a yum-based system, run the Debian update flow, verify enabled yum repos, and install a package on an Arch-based system.

Operator context

Patch work fails most often due to missing repo access, incorrect assumptions about which package manager is in use, or skipping “inspect before install.” This lab reinforces commands you can run quickly on unfamiliar systems to prove what the machine can actually see and do.

Objective

  • Inspect an RPM file with rpm -qpi before installing.
  • Install a package using yum.
  • Refresh package indexes and upgrade installed packages using apt.
  • List enabled repositories using yum repolist.
  • Install a package using pacman.

Concepts

  • Package manager identity matters: RPM tooling, yum/dnf, apt, and pacman are not interchangeable.
  • Repo visibility is often the root cause: an install failure is frequently a repo, mirror, or entitlement problem.
  • Inspect before install: use metadata checks to confirm name, version, and purpose before you change a system.
  • Predictable update flow: refresh indexes, then apply upgrades with controlled prompts.
  • Evidence-driven troubleshooting: validate the repo list and package availability before assuming “the package is missing.”

Walkthrough

Step 1 : Inspect RPM metadata before installation.
Command
rpm -qpi sample.rpm

Use this when someone hands you an RPM and you need confirmation of what it is (name/version/summary) before you install it.

Name        : sample
Version     : 1.0
Summary     : Example RPM package
Description : This is a sample RPM for training purposes.
Step 2 : Install a package on a yum-based system.
Command
sudo yum install -y nano

The -y flag is common in automation so the install can proceed without interactive prompting.

Loaded plugins: fastestmirror
Resolving Dependencies
--> Running transaction check
--> Installing : nano-2.9.8-1.el7.x86_64
Installed:
  nano.x86_64 0:2.9.8-1.el7
Complete!
Step 3 : Apply the Debian update workflow.
Command
sudo apt update && sudo apt upgrade -y

This is the standard two-phase flow: refresh package indexes, then apply upgrades.

Hit:1 http://deb.debian.org/debian stable InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
Upgrading...
Fetched 12.3 MB in 5s (2,360 kB/s)
Done.
Step 4 : Confirm enabled repos on a yum-based system.
Command
yum repolist

Repo visibility is a fast way to diagnose why a package cannot be found or why updates are failing.

Loaded plugins: fastestmirror
repo id                  repo name                                 status
base/7/x86_64            CentOS-7 - Base                           10,019
updates/7/x86_64         CentOS-7 - Updates                        1,002
extras/7/x86_64          CentOS-7 - Extras                           500
Step 5 : Install a package on an Arch-based system.
Command
sudo pacman -S neofetch

Pacman resolves dependencies and prompts before installing. Confirm the plan, then proceed when the transaction is correct.

resolving dependencies...
looking for conflicting packages...

Packages (1) neofetch-7.1.0-2

Total Installed Size:  0.20 MiB
:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring
(1/1) verifying package integrity
(1/1) loading package files
(1/1) checking for file conflicts
(1/1) installing neofetch

Common breakpoints

yum install fails: “No package available”

First verify repo visibility with yum repolist. If expected repos are missing, you are dealing with repo configuration, entitlements, DNS, proxy, or mirror access before you are dealing with package selection.

apt update fails: repository unreachable

Treat this as network or repo access until proven otherwise. Validate DNS and routing, confirm the configured sources, and re-run apt update after connectivity is restored.

rpm -qpi fails: “not an rpm package”

Confirm the file is actually an RPM and not a different package format or a truncated download. Validate the filename and source before attempting installation.

pacman cannot sync databases

This is typically mirror or network access. Confirm basic connectivity, then validate mirror configuration before retrying the install.

Cleanup checklist

This lab is safe by default. If you installed packages for the exercise, remove them to return the system to a clean baseline.

Commands
sudo yum remove -y nano
sudo apt remove -y nano
sudo pacman -R neofetch
Success signal

The packages are no longer present, and package managers report a clean state with no failed transactions.

Reference

  • rpm -qpi <file.rpm> : Query RPM package metadata from a file.
    • -q : Query mode.
    • -p : Query a package file instead of an installed package.
    • -i : Display detailed package information.
  • yum install <pkg> : Install a package on yum-based systems.
    • -y : Automatically answer “yes” to prompts.
  • apt update : Refresh package index information from repositories.
  • apt upgrade : Upgrade installed packages to newer versions.
    • -y : Automatically confirm upgrades.
  • yum repolist : List enabled repositories and available package counts.
  • pacman -S <pkg> : Install a package on Arch-based systems.
    • -S : Synchronize and install packages from repositories.
  • yum remove <pkg> : Remove a package on yum-based systems.
    • -y : Automatically answer “yes” to prompts.
  • apt remove <pkg> : Remove an installed package on Debian-based systems.
    • -y : Automatically confirm removal.
  • pacman -R <pkg> : Remove a package on Arch-based systems.
    • -R : Remove the specified package.