A package update broke an application. How do you roll it back?
IntermediateScenarioPackages, kernel and boot
Answer
Situation read → Downgrade to the previous version.
What I'd do →
- RHEL:
sudo dnf history list
sudo dnf history info <ID>
sudo dnf history undo <ID>
# or: sudo dnf downgrade nginx-1.24.0-1.el9
- Debian/Ubuntu:
apt list -a nginxthensudo apt install nginx=1.24.0-2ubuntu1, thenapt-mark hold nginx.
Why → dnf history undo reverses the whole transaction including dependencies.
Interview tip → The previous version must still be in the repo or cache, which is why internal mirrors keep old versions.
More on Packages, kernel and boot
You must upgrade the kernel on 50 production servers and be able to roll back if the new kernel misbehaves. Plan it.AdvancedYou need to pin a package version so routine updates don't upgrade it (e.g. Docker or PostgreSQL). How?BeginnerYour servers can't reach the internet but need packages. How do you provide repositories?IntermediateYou need to compile and install software from source on a server that also uses packages. How do you avoid making a mess?IntermediateYou need to change kernel boot parameters (e.g. add `transparent_hugepage=never`) persistently. How?IntermediateA server must apply kernel security patches without rebooting. What are your options?Advanced