0

Ubuntu 22.04 Desktop

Whenever my system updates it always reinstalls an older kernel. This stops the update because of insufficient space on /boot.

Also apt autoremove does not remove my outdated kernels

My curent /boot kernel files look like this:

-rw------- 1 root root 6.0M Sep  5 16:31 System.map-5.15.0-84-generic
-rw------- 1 root root 7.6M Aug 18 12:38 System.map-6.2.0-32-generic
-rw------- 1 root root 7.7M Sep  7 10:11 System.map-6.2.0-33-generic
lrwxrwxrwx 1 root root   25 Sep 19 11:04 vmlinuz -> vmlinuz-5.15.0-84-generic
-rw------- 1 root root  12M Sep  5 19:57 vmlinuz-5.15.0-84-generic
-rw------- 1 root root  14M Aug 18 12:40 vmlinuz-6.2.0-32-generic
-rw------- 1 root root  14M Sep  7 11:18 vmlinuz-6.2.0-33-generic
lrwxrwxrwx 1 root root   24 Sep 19 11:04 vmlinuz.old -> vmlinuz-6.2.0-33-generic

I noticed that there are some earlier kernels marked as manual in apt. I switched them to auto and redid purge but 5.15 is still there.

Anyone have any ideas?

Thanks in advance

David Kohen
  • 131
  • 4
  • 4
    Do you have both GA & HWE kernel stacks installed; if so you'd expect to see 5.15 (GA) + 6.2 (HWE); with both being updated with security fixes. – guiverc Sep 19 '23 at 08:49
  • No - only HWE as far as I know - certainly never asked for GA, and my hardware is very vanilla – David Kohen Sep 19 '23 at 11:49
  • Which kernel stack is installed by default varies on the ISO used to install (you didn't specify your product/flavor of 22.04 thus we cannot even know what is likely). You could try viewing what package(s) you have installed using dpkg -l |grep linux-generic but 5.15 will get re-install if either GA kernel stack was installed; OR you'd previously installed a 5.15 kernel. Ubuntu allows users to install multiple kernel stacks (and all will get upgrades if supported) – guiverc Sep 19 '23 at 11:54
  • dpkg -l |grep linux-generic returns nothing.My product flavor is pure Ubuntu - not one of the other flavors. – David Kohen Sep 19 '23 at 14:04
  • Classic apt misuse of "purge". Purge is not a synonym for "force". They do very different things, and neither seem necessary for the problem as currently described. – user535733 Sep 19 '23 at 15:59
  • Please edit your question to clarify: Ubuntu Desktop 22.04 or Ubuntu Server 22.04? – user535733 Sep 19 '23 at 16:00
  • Also please edit your question to show the complete output of sudo apt autoremove linux-image-5.15.0-84-generic. Read the output before agreeing to any removals. Reject the removal if the output says something unexpected. – user535733 Sep 19 '23 at 16:04
  • dpkg -l | grep linux-image please. – nobody Sep 19 '23 at 17:59
  • I booted a jammy or 22.04 system, and my own results for command I provided show both linux-image-generic and linux-image-generic-hwe-22.04 plus various kernel packages installed; I'd not expect no results (there is no mention of OEM kernels in your directory listing). Ubuntu or Ubuntu flavor are still Ubuntu systems (you didn't specify Desktop or Server, but they'll be the same; I used a desktop system) – guiverc Sep 19 '23 at 22:09
  • sudo apt autoremove linux-image-5.15.0-84-generic shows The following packages will be REMOVED: amd64-microcode intel-microcode iucode-tool linux-image-5.15.0-84-generic linux-image-generic linux-modules-5.15.0-84-generic linux-modules-extra-5.15.0-84-generic thermald

    but I've already done that, removed the package and then it was reinstalled on the next kernel update.

    I modified the original question to include the fact that it is a desktop system.

    – David Kohen Sep 22 '23 at 19:22
  • I found a partial answer here: https://askubuntu.com/questions/563483/why-doesnt-apt-get-autoremove-remove-my-old-kernels#563489 - it seems that autoremove will never remove a kernel unhttps://askubuntu.com/questions/563483/why-doesnt-apt-get-autoremove-remove-my-old-kernels#563489less it is specifcied - ok, I get that, but why is it reinstalling to (much) older kernel? – David Kohen Sep 22 '23 at 19:28
  • Autoremove will remove kernels. You are almost certainly getting this issue because you have the HWE and 'base' kernel packages both installed. To fix it, do this https://askubuntu.com/a/885582/243321 – Organic Marble Sep 22 '23 at 23:44

0 Answers0