diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2020-12-17 15:21:17 +0100 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2021-01-04 10:54:42 +0100 |
commit | 38c49b8adeadf54f147140b3a5db7693e9b9b50f (patch) | |
tree | ad2f16d213927733b150f599c7fdc32de6d3eedb | |
parent | 944baec85a7496c1595242a31f6b1b37530451a5 (diff) |
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.
-rw-r--r-- | apt-pkg/algorithms.cc | 2 |
1 files changed, 1 insertions, 1 deletions
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; |