Only keep 2 kernels
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Ubuntu) |
Fix Released
|
High
|
Julian Andres Klode | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Impish |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
APT currently keeps 3 kernels or even 4 in some releases. Our boot partition is sized for a steady state of 2 kernels + 1 new one being unpacked, hence users run out of space and new kernels fail to install, upgrade runs might abort in the middle. It's not nice.
[Test plan]
1. Have two kernels installed (let's call them version 3, 2)
2. Check that both kernels are not autoremovable
3. Install an old kernel (let's call it 1), and mark it automatic
4. Check that 1 will be autoremovable (apt autoremove -s)
5. Reboot into 1, check that 2 is autoremovable (apt autoremove -s)
6. Actually remove 2
7. Reboot into 3 and check that both 1 and 3 are now not autoremovable
[Where problems could occur]
We could keep the wrong kernels installed that the user did not expect.
We remove the requirement to keep the most recently installed version, previously recorded in APT::LastInstal
1. keep booted kernel
2. keep highest version
3. keep most recently installed
1 can't be removed as it would break running systems, 2 is what you definitely want to keep.
During normal system lifetime, the most recently installed kernel is the same as the highest version, so 2==3, and there are no changes to behavior.
Likewise, if you most recently installed an older kernel manually for debugging, it would be manually installed and not subject to removal, even if the rule is dropped.
The behavior really only changes if you install an older kernel, and then mark it auto - that older kernel becomes automatically removable immediately after it is marked as auto.
description: | updated |
description: | updated |
Changed in apt (Ubuntu): | |
status: | New → In Progress |
importance: | Undecided → High |
assignee: | nobody → Julian Andres Klode (juliank) |
tags: | added: fr-2155 |
description: | updated |
Changed in apt (Ubuntu Impish): | |
status: | New → In Progress |
no longer affects: | unattended-upgrades (Ubuntu Impish) |
no longer affects: | unattended-upgrades (Ubuntu Focal) |
no longer affects: | unattended-upgrades (Ubuntu Bionic) |
no longer affects: | unattended-upgrades (Ubuntu) |
description: | updated |
This bug was fixed in the package apt - 2.4.5
---------------
apt (2.4.5) unstable; urgency=medium
* Only protect two kernels, not last installed one (LP: #1968154) PTGet:: tryVirtualPacka ge()
* Fix segfault in CacheSetHelperA
-- Julian Andres Klode <email address hidden> Fri, 08 Apr 2022 12:22:23 +0200