dnf history undo versus GRUB kernel fallback for config preservation after a failed upgrade
0 reputation · 22 May 2020, 11:46 UTC
0 reputation · 22 May 2020, 11:46 UTC
Goal is to recover a Rocky Linux system after a failed upgrade while keeping service configuration consistent and avoiding manual drift.
The documented recovery options are dnf history undo, which reverts package transactions, and GRUB kernel fallback, which allows booting a previously installed kernel without reverting packages. dnf history undo is known to revert installed packages but does not automatically restore configuration files that were removed or altered during the upgrade, and may leave orphaned systemd units or services in a changed state. GRUB fallback preserves the upgraded package set and any configuration changes made by the upgrade, relying on the older kernel for bootability.
With Rocky Linux 9.x and dnf 4.x assumptions, the unresolved decision is how configuration file and systemd unit state should be treated when choosing between package rollback and kernel fallback.
Does dnf history undo restore configuration files removed during the upgrade transaction? What is the documented interaction between GRUB kernel fallback and upgraded services and unit files? Is there a documented policy for reconciling configuration drift when package rollback and kernel fallback are considered together?
35275 reputation · 22 May 2020, 18:56 UTC
To recover a Rocky Linux 9.x system while maintaining configuration consistency, you must choose between reverting the software state or reverting the boot environment. Neither method provides a fully automated "snapshot" restoration of configuration files.
| Feature | dnf history undo | GRUB Kernel Fallback |
|---|---|---|
| Package Versions | Reverts to pre-transaction versions | Keeps upgraded package versions |
| Config Files (/etc) | Not restored; remains in upgraded state | Preserved in upgraded state |
| Systemd Units | May leave orphaned units/services | Keeps upgraded units; may mismatch kernel |
| Boot Kernel | Remains current (unless kernel was rolled back) | Boots previous known-good kernel |
dnf history undo: This command reverts the package installation state but does not track or revert changes made to configuration files in /etc. If the upgrade process modified a config file or deleted one, dnf history undo will not restore the original file. This creates configuration drift, where old package binaries are paired with new configuration syntax, often leading to service failure.
GRUB Kernel Fallback: This method preserves the upgraded package set and all configuration changes. The system boots using an older kernel, but the services running in userspace are the upgraded versions. The primary risk here is a kernel-userspace mismatch, where an upgraded service requires a kernel module or feature not present in the fallback kernel.
dnf history undo, manually verify critical configurations. Use the following to check for modified files: rpm -V package_namednf undo, check for failed services that no longer have supporting binaries: systemctl list-units --failed/etc files against your last known-good backup to resolve drift.Missing Diagnostic Detail: Did the failed upgrade include a kernel update or a major version jump (e.g., 9.x to 9.y)? If the kernel was the primary cause of failure, GRUB fallback is the priority; if application-level dependencies broke, dnf undo is required.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.