Interview Prep/Linux/Packages, kernel and boot

You want to keep `/boot` from filling with old kernels. How do you manage that?

BeginnerScenarioPackages, kernel and boot
Answer

Situation read → Limit installed kernels.

What I'd do →

  • RHEL: installonly_limit=3 in /etc/dnf/dnf.conf, clean up with sudo dnf remove --oldinstallonly --setopt installonly_limit=2 kernel.
  • Ubuntu: sudo apt autoremove --purge.
  • Check usage: df -h /boot and rpm -q kernel / dpkg -l 'linux-image*'.

Why → A full /boot makes the next kernel install fail half-way.

Interview tip → Never remove the running kernel (uname -r).

All Linux questions Roadmap: Linux

More on Packages, kernel and boot