You must upgrade the kernel on 50 production servers and be able to roll back if the new kernel misbehaves. Plan it.
AdvancedScenarioPackages, kernel and boot
Answer
Situation read → Kernels install side by side, so rollback is choosing the old one at boot. The risk is in the reboot itself.
What I'd do →
- Test the new kernel on staging and a canary host for a few days.
- Make sure old kernels are kept:
installonly_limit=3in/etc/dnf/dnf.conf(apt keeps the previous one by default). - Roll out in batches: drain the host,
dnf update kernel/apt install linux-image-..., reboot, checkuname -r, health checks, re-add to the LB. - Rollback on a host:
sudo grubby --info=ALL | grep -E '^(index|kernel)'
sudo grubby --set-default /boot/vmlinuz-<old-version>
sudo reboot
- Have console access ready in case the new kernel doesn't boot at all; pick the old entry from the GRUB menu.
Why → Batches limit the blast radius; keeping old kernels makes rollback a reboot, not a reinstall.
Interview tip → Mention grub2-reboot <entry> for a one-time boot into the new kernel, falling back automatically on the next reboot if it hangs and gets power-cycled.
More on Packages, kernel and boot
You need to pin a package version so routine updates don't upgrade it (e.g. Docker or PostgreSQL). How?BeginnerA package update broke an application. How do you roll it back?IntermediateYour 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