Loading...

Lab 74: Rolling Back Patches and Updates

Roll back a problematic update using the native downgrade and history mechanisms across RPM, yum/dnf-style transaction history, APT version pinning, 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, you typically 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 version pinning.
  • Downgrade an Arch package by installing a cached .pkg.tar.zst file with pacman.

What You’ll Practice

  • RPM downgrade mechanics with rpm -Uvh --oldpackage.
  • Transaction rollback on yum-based systems using yum history undo.
  • Installing a specific package version with apt install pkg=version.
  • Installing local cached packages on Arch using pacman -U.

Walkthrough

Step 1 : RHEL-style rollback using RPM directly.
Command
rpm -Uvh --oldpackage bash-5.1.rpm

--oldpackage allows installing an older version over a newer one. This is a direct “restore known-good” move when you have the correct RPM artifact available.

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

yum history tracks prior transactions. Undoing the last transaction is a fast way to revert an update that caused immediate regressions.

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

Specifying pkg=version forces APT to install that exact version if it is available in your configured sources. This is a clean, explicit downgrade path with clear intent.

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 previous artifact present in /var/cache/pacman/pkg.

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

Reference

  • rpm -Uvh --oldpackage <pkg.rpm> : Install an older RPM version over a newer installed one.
  • 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).