Saturday, April 27, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 568  / 2 Years ago, fri, july 8, 2022, 1:43:30

I am on Ubuntu 20.04 and I trying to understand what's going on with my Linux kernels, and there is something that looks odd to me. The current kernel should be:


@precision-3551:~$ uname -r
5.13.0-44-generic

But I can also see that there are other installed kernels. One curious thing is that the installed kernels are either 5.13 or 5.4, with nothing in between:


@precision-3551:~$ dpkg --list | egrep -i --color 'linux-image|linux-headers'
ii linux-headers-5.0.0-1034-oem-osp1 5.0.0-1034.39 amd64 Linux kernel headers for version 5.0.0 on 64 bit x86 SMP
ii linux-headers-5.13.0-41-generic 5.13.0-41.46~20.04.1 amd64 Linux kernel headers for version 5.13.0 on 64 bit x86 SMP
ii linux-headers-5.13.0-44-generic 5.13.0-44.49~20.04.1 amd64 Linux kernel headers for version 5.13.0 on 64 bit x86 SMP
ii linux-headers-5.4.0-113 5.4.0-113.127 all Header files related to Linux kernel version 5.4.0
ii linux-headers-5.4.0-113-generic 5.4.0-113.127 amd64 Linux kernel headers for version 5.4.0 on 64 bit x86 SMP
ii linux-headers-generic 5.4.0.113.117 amd64 Generic Linux kernel headers
ii linux-headers-generic-hwe-20.04 5.13.0.44.49~20.04.28 amd64 Generic Linux kernel headers
rc linux-image-5.0.0-1034-oem-osp1 5.0.0-1034.39 amd64 Signed kernel image oem-osp1
ii linux-image-5.13.0-41-generic 5.13.0-41.46~20.04.1 amd64 Signed kernel image generic
ii linux-image-5.13.0-44-generic 5.13.0-44.49~20.04.1 amd64 Signed kernel image generic
rc linux-image-5.4.0-100-generic 5.4.0-100.113 amd64 Signed kernel image generic
rc linux-image-5.4.0-104-generic 5.4.0-104.118 amd64 Signed kernel image generic
rc linux-image-5.4.0-105-generic 5.4.0-105.119 amd64 Signed kernel image generic
rc linux-image-5.4.0-107-generic 5.4.0-107.121 amd64 Signed kernel image generic
rc linux-image-5.4.0-109-generic 5.4.0-109.123 amd64 Signed kernel image generic
rc linux-image-5.4.0-110-generic 5.4.0-110.124 amd64 Signed kernel image generic
ii linux-image-5.4.0-113-generic 5.4.0-113.127 amd64 Signed kernel image generic
rc linux-image-5.4.0-65-generic 5.4.0-65.73~18.04.1 amd64 Signed kernel image generic
rc linux-image-5.4.0-66-generic 5.4.0-66.74~18.04.2 amd64 Signed kernel image generic
rc linux-image-5.4.0-70-generic 5.4.0-70.78~18.04.1 amd64 Signed kernel image generic
rc linux-image-5.4.0-71-generic 5.4.0-71.79~18.04.1 amd64 Signed kernel image generic
rc linux-image-5.4.0-72-generic 5.4.0-72.80~18.04.1 amd64 Signed kernel image generic
rc linux-image-5.4.0-73-generic 5.4.0-73.82~18.04.1 amd64 Signed kernel image generic
rc linux-image-5.4.0-74-generic 5.4.0-74.83~18.04.1 amd64 Signed kernel image generic
rc linux-image-5.4.0-77-generic 5.4.0-77.86~18.04.1 amd64 Signed kernel image generic
rc linux-image-5.4.0-80-generic 5.4.0-80.90~18.04.1 amd64 Signed kernel image generic
rc linux-image-5.4.0-81-generic 5.4.0-81.91~18.04.1 amd64 Signed kernel image generic
rc linux-image-5.4.0-84-generic 5.4.0-84.94~18.04.1 amd64 Signed kernel image generic
rc linux-image-5.4.0-86-generic 5.4.0-86.97~18.04.1 amd64 Signed kernel image generic
rc linux-image-5.4.0-87-generic 5.4.0-87.98~18.04.1 amd64 Signed kernel image generic
rc linux-image-5.4.0-89-generic 5.4.0-89.100~18.04.1 amd64 Signed kernel image generic
rc linux-image-5.4.0-90-generic 5.4.0-90.101 amd64 Signed kernel image generic
rc linux-image-5.4.0-91-generic 5.4.0-91.102 amd64 Signed kernel image generic
rc linux-image-5.4.0-92-generic 5.4.0-92.103 amd64 Signed kernel image generic
rc linux-image-5.4.0-94-generic 5.4.0-94.106 amd64 Signed kernel image generic
rc linux-image-5.4.0-96-generic 5.4.0-96.109 amd64 Signed kernel image generic
rc linux-image-5.4.0-97-generic 5.4.0-97.110 amd64 Signed kernel image generic
rc linux-image-5.4.0-99-generic 5.4.0-99.112 amd64 Signed kernel image generic
ii linux-image-generic 5.4.0.113.117 amd64 Generic Linux kernel image
ii linux-image-generic-hwe-20.04 5.13.0.44.49~20.04.28 amd64 Generic Linux kernel image
ii linux-image-oem-osp1 5.4.0.113.117 amd64 Depends on the generic kernel image (dummy transitional package)
@precision-3551:~$ dpkg --list | grep -i -E --color 'linux-image|linux-kernel' | grep '^ii'
ii linux-image-5.13.0-41-generic 5.13.0-41.46~20.04.1 amd64 Signed kernel image generic
ii linux-image-5.13.0-44-generic 5.13.0-44.49~20.04.1 amd64 Signed kernel image generic
ii linux-image-5.4.0-113-generic 5.4.0-113.127 amd64 Signed kernel image generic
ii linux-image-generic 5.4.0.113.117 amd64 Generic Linux kernel image
ii linux-image-generic-hwe-20.04 5.13.0.44.49~20.04.28 amd64 Generic Linux kernel image
ii linux-image-oem-osp1

And when I try purge, I don't get any listed ones:


@precision-3551:~$ sudo apt --purge autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

I have also looked into /etc/apt/apt.conf.d/01autoremove-kernels, as suggested by this answer, but that file does not exist in my case.
I think that by removing the 5.4 kernels I can save a bit of space. How can I do that or is there any signs I shouldn't?


More From » apt

 Answers
3

Let's take a minute and simply reorganize that list. Maybe it will make more sense now:


// OEM Kernel packages
ii linux-image-oem-osp1 5.4.0.113.117 amd64 Depends on the generic kernel image (dummy transitional package)
ii linux-headers-5.0.0-1034-oem-osp1 5.0.0-1034.39 amd64 Linux kernel headers for version 5.0.0 on 64 bit x86 SMP
rc linux-image-5.0.0-1034-oem-osp1 5.0.0-1034.39 amd64 Signed kernel image oem-osp1

// Original 20.04 kernel 5.4 packages
ii linux-image-generic 5.4.0.113.117 amd64 Generic Linux kernel image
ii linux-image-5.4.0-113-generic 5.4.0-113.127 amd64 Signed kernel image generic
ii linux-headers-generic 5.4.0.113.117 amd64 Generic Linux kernel headers
ii linux-headers-5.4.0-113 5.4.0-113.127 all Header files related to Linux kernel version 5.4.0
ii linux-headers-5.4.0-113-generic 5.4.0-113.127 amd64 Linux kernel headers for version 5.4.0 on 64 bit x86 SMP

// Hardware Enablement (HWE) 20.04 kernel 5.13 packages
ii linux-image-generic-hwe-20.04 5.13.0.44.49~20.04.28 amd64 Generic Linux kernel image
ii linux-image-5.13.0-41-generic 5.13.0-41.46~20.04.1 amd64 Signed kernel image generic
ii linux-image-5.13.0-44-generic 5.13.0-44.49~20.04.1 amd64 Signed kernel image generic
ii linux-headers-generic-hwe-20.04 5.13.0.44.49~20.04.28 amd64 Generic Linux kernel headers
ii linux-headers-5.13.0-41-generic 5.13.0-41.46~20.04.1 amd64 Linux kernel headers for version 5.13.0 on 64 bit x86 SMP
ii linux-headers-5.13.0-44-generic 5.13.0-44.49~20.04.1 amd64 Linux kernel headers for version 5.13.0 on 64 bit x86 SMP


  • rc kernels are not installed, and take no space. Those are simply entries in the apt database of kernels that apt knew about in the past. We ignore most of them.



  • You have an OEM kernel metapackage and headers. OEM kernels are intended for specific hardware for a limited time, until hardware support for that hardware finds its way into the mainline kernel. If your hardware works fine on your current 5.13 kernel, then you don't need those 5.0 and 5.4 OEM kernel packages anymore. Simply apt remove them: sudo apt remove linux-image-oem-osp1 linux-headers-5.0.0-1034-oem-osp1. See? That was easy.



  • You have the original 5.4 kernel stack that came with Ubuntu 20.04. But you are not using it (you are using the HWE 5.13 series). Unless you plan to revert to 5.4, you can simply apt remove those five packages.



  • You have two versions of your current 5.13 kernel, -44 and the older -41. That's what correct looks like (you should indeed have two). DON'T remove any of those packages. Let apt handle this series automatically.



  • Looks like there is nothing wrong with apt. It is indeed automatically deleting older kernels -- that's why you have so many rc kernels listed. You have so many installed kernels because you --the human admin-- did not instruct apt to uninstall those OEM and 5.4 metapackages, and pulling in additional kernels is what those metapackages do!




[#470] Saturday, July 9, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ntlesslving

Total Points: 123
Total Questions: 109
Total Answers: 113

Location: South Korea
Member since Fri, Sep 11, 2020
4 Years ago
;