4

i have the following kernels :

linux-image-5.11.0-27-generic
linux-image-5.11.0-38-generic
linux-image-generic-hwe-20.04

I would like to delete these 2 kernels

linux-image-5.11.0-27-generic  
linux-image-generic-hwe-20.04
  1. Is it safe to do so?
  2. I tried using sudo apt autoremove --purge to delete old kernels but the old kernels still show up?
3
  • @user68186 This is a good answer.
    – Pilot6
    Oct 26 at 20:24
  • 1
    @Pilot6 I have turned my comment to an answer. :)
    – user68186
    Oct 26 at 20:38
  • If you think one of the answers are correct please click on the gray check mark 🗸 next to the answer and turn it green ✅. This will mark your problem as solved and help others find the right answer.
    – user68186
    Oct 26 at 21:18
11

Don't delete these files!

It looks like you have two kernels:

  • The current one ending with -38,
  • And one before that ending with -27.

This is normal for Ubuntu. One older kernel (-27) is there for your protection. If for any reason the current kernel breaks you will be able to boot using the older one.

The linux-image-generic-hwe-20.04 is not a kernel. It is "meta package" that tells Ubuntu which kernels to keep up to date. If you delete it, you will not get any kernel security updates.

In other words, don't mess with kernel files. always use sudo apt autoremove. It will always keep the last two kernels.

Hope this helps

4

The package linux-image-generic-hwe-20.04 is not as such a kernel. It is the metapackage that brings in the newest kernel image for the kernels from the HWE stack.

Ubuntu 20.04 is a long term release. In principle, it remains on the same long term supported kernel release for the entire support time. However, later in the release cycle, i.e., starting with the .2 version (20.04.2), updated installation media are shipped with updated kernels, the so called Hardware Enablement (HWE) stack. This allows the long term release to continue working properly with newer hardware.

The package linux-image-generic-hwe-20.04 in turn depends on linux-generic-hwe-20.04. That is the top level metapackage that ensures that the HWE kernel (image and headers) are automatically updated to the latest available version. For the regular kernel series, the linux-generic package fulfills that role.

You can delete that package, but if you do, also linux-generic-hwe-20.04 will be removed, and linux-image-generic-hwe-20.04 will be removed with the next autoremove. You will not break your system, but your kernels will not anymore be automatically updated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.