Public bug reported:

Actually, I'm not 100% sure it's Discover's fault, but I'm quite
confident it could the source of the problem.

On 2021-01-27, when trying to install the latest kernel version for my Kubuntu 
20.04 installation, I went out of space in my /boot partition. Looking at the 
installed kernels, I saw that I had 6 (SIX!) old kernels installed, including 
the one I was running on.
I knew I had all the automatic kernel update and cleaning in place thanks to 
unattended-upgrades, because I looked at it some time ago, so, I took back the 
Ubuntu documentation page at https://help.ubuntu.com/community/RemoveOldKernels 
and re-read it from scratch.
Substantially this sentence is enlightening:

Note: The following methods will only remove kernels that are marked as
being automatically installed as described above.

My problem was that all the installed kernels where marked as MANUALLY
INSTALLED:

$ apt-mark showauto 'linux-image-.*' 
linux-image-generic 
$ apt-mark showmanual 'linux-image-.*' 
linux-image-5.4.0-54-generic 
linux-image-5.4.0-56-generic 
linux-image-5.4.0-58-generic 
linux-image-5.4.0-59-generic 
linux-image-5.4.0-62-generic 
linux-image-5.4.0-64-generic 
linux-image-5.4.0-65-generic

(note: the last kernel version was the one I was not able to completely
install due to insufficient disk space)

Also, looking at /etc/apt/apt.conf.d/01autoremove-kernels I had:

rc  linux-image-5.4.0-42-generic                                5.4.0-42.46     
                            amd64        Signed kernel image generic 
rc  linux-image-5.4.0-48-generic                                5.4.0-48.52     
                            amd64        Signed kernel image generic 
rc  linux-image-5.4.0-51-generic                                5.4.0-51.56     
                            amd64        Signed kernel image generic 
rc  linux-image-5.4.0-52-generic                                5.4.0-52.57     
                            amd64        Signed kernel image generic 
rc  linux-image-5.4.0-53-generic                                5.4.0-53.59     
                            amd64        Signed kernel image generic 
rc  linux-image-5.4.0-60-generic                                5.4.0-60.67     
                            amd64        Signed kernel image generic 
ii  linux-image-5.4.0-62-generic                                5.4.0-62.70     
                            amd64        Signed kernel image generic 
ii  linux-image-5.4.0-64-generic                                5.4.0-64.72     
                            amd64        Signed kernel image generic 
iF  linux-image-5.4.0-65-generic                                5.4.0-65.73     
                            amd64        Signed kernel image generic 
ii  linux-image-generic                                         5.4.0.65.68     
                            amd64        Generic Linux kernel image

So, some kernel versions were indeed automatically pruned in the past
(those marked with "rc"), but other are missing there and indeed they
were marked as "manually installed".

Running "apt autoremove" manually of course does not remove old kernels,
for the same reason.

I'm pretty sure the problem lies here: some kernel version were
automatically installed by unattended-upgrades (and these where
automatically purged), some others were installed by me by hitting
"update all" button in Discover, when it periodically notifies me about
new updates.

So, looking again at the Ubuntu wiki page, I see:

In Ubuntu 16.04 kernels installed by Software Updater are marked as
being automatically installed. In Ubuntu 14.04 only kernels installed by
unattended-upgrades are marked as being automatically installed. See bug
#1439769 for details.

So, I suspect such a "bug" is still present in Kubuntu 20.04 Discover,
which marks all kernels installed through it as "manually installed".

This problem has also been reported already at:
https://bugs.kde.org/show_bug.cgi?id=430296
https://github.com/hughsie/PackageKit/issues/450

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: plasma-discover 5.18.5-0ubuntu0.1
ProcVersionSignature: Ubuntu 5.4.0-65.73-generic 5.4.78
Uname: Linux 5.4.0-65-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.16
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: KDE
Date: Sun Feb  7 14:47:01 2021
InstallationDate: Installed on 2020-10-05 (124 days ago)
InstallationMedia: Kubuntu 20.04.1 LTS "Focal Fossa" - Release amd64 (20200731)
SourcePackage: plasma-discover
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: plasma-discover (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug focal third-party-packages

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1914932

Title:
  Kernel updates marked as "manually installed", prevents old kernels
  cleanup

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/plasma-discover/+bug/1914932/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to