Interview Prep/Linux/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.

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 →

  1. Test the new kernel on staging and a canary host for a few days.
  2. Make sure old kernels are kept: installonly_limit=3 in /etc/dnf/dnf.conf (apt keeps the previous one by default).
  3. Roll out in batches: drain the host, dnf update kernel / apt install linux-image-..., reboot, check uname -r, health checks, re-add to the LB.
  4. Rollback on a host:
sudo grubby --info=ALL | grep -E '^(index|kernel)'
sudo grubby --set-default /boot/vmlinuz-<old-version>
sudo reboot
  1. 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.

All Linux questions Roadmap: Linux

More on Packages, kernel and boot