Loading...

Lab 74: Rolling Back Patches and Updates

Roll back a problematic update using downgrade and transaction history workflows across RPM, yum-style history undo, APT version installs, and pacman cache installs. The goal is to restore a known-good package state while preserving a clear audit trail of what changed.

packages rollback troubleshooting core

Scenario

A recent patch introduced regressions and your priority is to return systems to a stable baseline. You will practice rollback workflows on multiple distro families so you can respond quickly when a package update breaks production behavior.

Operator context

Rollback is a stabilization move. In the field, pair it with incident notes: what changed, what version you reverted to, and how you validated recovery (service health, logs, and user impact).

Objective

  • Install an older RPM over a newer one using rpm --oldpackage.
  • Undo the most recent yum transaction using yum history.
  • Downgrade a Debian package to a specific version using APT.
  • Downgrade an Arch package by installing a cached .pkg.tar.zst file with pacman.

Concepts

  • Rollback versus fix-forward: roll back to stabilize now, then investigate and remediate the upstream issue.
  • Artifact-based downgrade: you need the exact older package artifact (RPM file, cached pacman package, available APT version).
  • Transaction history: yum/dnf history can undo grouped changes when a single update included multiple packages.
  • Audit trail: record the package, version, and validation steps so the rollback is explainable and repeatable.
  • Guardrails: confirm the target version is safe and compatible with dependencies before you downgrade.

Walkthrough

Step 1 : Roll back using RPM directly (older RPM over newer).
Safety note

Downgrades can break dependencies. In production, verify the service impact and coordinate change windows when the package is critical.

Command
rpm -Uvh --oldpackage bash-5.1.rpm

--oldpackage allows installing an older version over a newer one. This is the most direct rollback path when you already have the known-good RPM artifact available.

Preparing...    ################################# [100%]
Updating / installing...
  1: bash-5.1  ################################# [100%]
Step 2 : Roll back using yum history.
Command
yum history undo last

yum history tracks transactions. Undoing the last transaction is a fast way to revert a regression that appeared immediately after an update.

Loaded plugins: fastestmirror
Undoing transaction 33...
Reverting installed/erased/updated packages...
Step 3 : Debian/Ubuntu downgrade by installing a specific version.
Command
sudo apt install bash=5.1-2ubuntu3

Installing pkg=version forces APT to select that exact version if it is available in your configured sources. This is explicit, repeatable, and easy to document.

Reading package lists... Done
The following packages will be downgraded:
  bash
Step 4 : Arch Linux downgrade from the pacman cache.
Command
sudo pacman -U /var/cache/pacman/pkg/bash-5.1.pkg.tar.zst

Installing a cached package file is the standard Arch rollback move when you have the prior artifact in /var/cache/pacman/pkg.

:: Processing package changes...
:: Downgrading bash...

Common breakpoints

Older package not available

Downgrade requires the older artifact. On Debian systems, the target version must be available in sources. On Arch, the cache must contain the prior package file, or you need another trusted source for the older package.

Dependency conflicts on downgrade

The older version may not satisfy current dependencies. Treat this as a change-management decision: roll back a set of related packages together, or fix-forward to a corrected update.

yum history undo cannot resolve

If repos changed since the transaction (or packages are no longer available), undo may fail. Keep local mirrors or snapshot repos when rollback speed matters.

Rollback succeeded but issue persists

If symptoms remain, the cause may be config drift, database migrations, or service state. Validate service health, logs, and any post-update changes that are not reverted by package rollback.

Cleanup checklist

This lab changes package state by design. After practicing, either return to your baseline version (upgrade back) or keep the downgraded state and document the exact versions as your known-good reference.

Commands
# Record installed version after rollback:
rpm -q bash || true
dpkg -l bash 2>/dev/null | head -n 5 || true
pacman -Qi bash 2>/dev/null | sed -n '1,12p' || true
Success signal

The service stabilizes after rollback, and you can state exactly what version you reverted to and how you validated recovery.

Reference

  • rpm -Uvh --oldpackage <pkg.rpm> : Install an older RPM version over a newer installed one.
    • --oldpackage: Allow downgrade.
    • -U: Upgrade or install package.
  • yum history undo last : Revert the most recent yum transaction.
  • apt install <pkg>=<version> : Install a specific version of a package (downgrade if needed).
  • pacman -U /path/to/pkg.tar.zst : Install a local package file (commonly used for downgrades from the pacman cache).
  • rpm -q <pkg> : Query installed RPM package version.
  • dpkg -l <pkg> : List Debian package status and version.
  • pacman -Qi <pkg> : Show installed package details on Arch.