Thursday, June 13, 2019

18.04 - Logic for removing old kernels

As of 18.04, Ubuntu removes old kernels when upgrading to a new one. As far as I can tell, this procedure is part of the install process. I currently have 3 different kernel versions installed on my machine.



After a kernel update which seems to have broken my system, requiring me to manually boot an old kernel, I am now wondering what logic Ubuntu uses to decide which kernels to keep around and which ones to remove. Specifically, I want to know whether the working kernel will eventually be rotated out of the kernels to keep around.




  • Am I right that all kernel cleanup tasks are executed at install time, with nothing deferred until the system is rebooted? (As in the latter case, these deferred tasks could theoretically remove any kernel other then the newly installed one.)

  • How does Ubuntu determine which kernels to remove? Does it simply keep the n most recent kernels, or is the logic more complex than that?

  • Is the kernel running at the time of the update guaranteed to be kept around until the next update?


  • Does Ubuntu have any tracking mechanism to detect which kernels have booted cleanly, and ensure not all of them are erased?

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...