From 38c49b8adeadf54f147140b3a5db7693e9b9b50f Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 17 Dec 2020 15:21:17 +0100 Subject: Only keep up to 3 (not 4) kernels This fixes a problem on Ubuntu systems where the /boot partition has been sized to manage 3 kernels, but does not really work with 4 kernels which was causing problems all over the place. --- apt-pkg/algorithms.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 702030943..a8e198054 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -1580,7 +1580,7 @@ std::string GetProtectedKernelsRegex(pkgCache *cache, bool ReturnRemove) std::clog << "Keeping latest kernel " << latest->first << std::endl; keep.insert(latest->first); } - if (previous != version2unames.rend()) + if (keep.size() < 3 && previous != version2unames.rend()) { if (Debug) std::clog << "Keeping previous kernel " << previous->first << std::endl; -- cgit v1.2.3