summaryrefslogtreecommitdiff
path: root/debian/apt.postinst
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2022-04-06 13:51:08 +0200
committerJulian Andres Klode <julian.klode@canonical.com>2022-04-07 13:19:52 +0200
commit824651ded0bcf8603e9b508860b8fe5a68fc53ff (patch)
treeea9b042a2d16cfc6723851faf87c119d03d9b78f /debian/apt.postinst
parent023c270e27e09cad9f35908caeb933fb23f8bd79 (diff)
Only protect two kernels, not last installed one
The kernel autoremoval algorithm was written to accomodate for Ubuntu's boot partition sizing, which was written to accomodate 3 kernels - 2 installed ones + a new one being unpacked. It seems that when the algorithm was designed, it was overlooked that it actually kept 3 kernels. LP: #1968154
Diffstat (limited to 'debian/apt.postinst')
-rwxr-xr-xdebian/apt.postinst5
1 files changed, 5 insertions, 0 deletions
diff --git a/debian/apt.postinst b/debian/apt.postinst
index 837b46b7b..8a623f2fd 100755
--- a/debian/apt.postinst
+++ b/debian/apt.postinst
@@ -7,4 +7,9 @@ if [ "$1" = 'configure' ]; then
--no-create-home --quiet _apt || true
fi
+if [ "$1" = "configure" ] && [ -n "$2" ] && dpkg --compare-versions -- "$2" le-nl "2.4.5~"; then
+ rm -f /etc/apt/apt.conf.d/01autoremove-kernels
+fi
+
+
#DEBHELPER#