Atomic rollback with occasional local packages: DNF transactions or image-based updates
0 reputation · 18 Dec 2020, 20:47 UTC
0 reputation · 18 Dec 2020, 20:47 UTC
For Rocky Linux hosts that must recover quickly after a failed update while still supporting occasional ad-hoc local RPMs, the documented update models present a trade-off. Traditional DNF transactions allow per-package installs and third-party RPMs built for the matching RHEL minor release, but dnf history rollback does not reliably restore a prior kernel, bootloader entry, or coherent userspace state. Image-based updates using bootable container images provide atomic staging with reboot-into-previous-deployment rollback, yet locally layered packages persist across base-image updates and can drift out of sync with base-image libraries. Out-of-tree kernel modules add another variable: under image mode they must match the exact base-image kernel and trust chain, while the DNF path handles them through akmods or dkms at update time. Rocky Linux tracks RHEL minors but is not byte-identical, so image-mode tooling defaults and module handling need confirmation against Rocky's own release notes for the target release rather than assumed RHEL behavior. Secure Boot, disk encryption, and hardware driver behavior may only surface on real hardware, not in disposable VMs.
Which approach better serves a fleet with short maintenance windows and intermittent local packages? Is there a documented Rocky Linux policy for when to layer an RPM into an image versus rebuilding the base image? How should out-of-tree modules be managed under image mode without breaking the rollback guarantee?
31775 reputation · 18 Dec 2020, 22:32 UTC
For a fleet with short maintenance windows and intermittent local RPMs, image-based updates (bootc/ostree-style deployments) are the better fit because rollback is a bootloader selection into a previously staged deployment, restoring the kernel, initramfs, and userspace together. DNF's history rollback reverses RPM database entries but does not guarantee a coherent prior kernel or bootloader state.
Confirmed by general EL ecosystem behavior: DNF transactions accept arbitrary third-party RPMs at runtime, while image-based updates stage complete deployments atomically. Locally layered packages in image mode persist across base-image updates and can drift from base-image libraries.
Requires verification against Rocky Linux release notes: Rocky tracks RHEL minors but is not byte-identical. Specific bootc/ostree defaults, module signing requirements, and any Rocky-specific policy on layering versus rebuilding must be confirmed for your target Rocky minor release rather than assumed from RHEL or Fedora documentation.
Rocky Linux does not publish a single, blanket policy that resolves every layering-versus-rebuild case. A practical split:
Requires: kernel = <version>; verify with rpm -q --requires <pkg>.# Confirm DNF rollback gap on a disposable test host
sudo dnf history rollback <txid>
# After reboot, compare running kernel and default boot entry
uname -r
grubby --default-kernel
# After a base-image update, inventory layered packages
rpm -qa | grep '^layered-'
# Check for library drift on a layered binary
ldd /usr/bin/<layered-binary>
# Boot the previous deployment and confirm module state
lsmod | grep <module_name>Do your hosts require Secure Boot with custom MOK enrollment? If yes, module signing and shim behavior must be scripted into the image build; otherwise, image mode may be blocked on real hardware even if it works in a VM.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.