Score:5

Can I delete linux-image-generic-hwe-20.04?

jp flag

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?
Pilot6 avatar
cn flag
@user68186 This is a good answer.
ar flag
@Pilot6 I have turned my comment to an answer. :)
ar flag
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.
Score:13
ar flag

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

Score:5
cn flag

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.

chx101 avatar
za flag
Can you reinstall these? If so, please add that yo your answer. Thank you
Joooeey avatar
in flag
I needed to downgrade to an older kernel for driver compatibility reasons. Let's say to 5.11.22. So I removed `linux-image-generic-hwe-20.04`, `linux-headers-generic-hwe-20.04`, `linux-generic-hwe-20.04`. What do I need to do to get kernel upgrades to 5.11.23, 5.11.24 etc.?
vanadium avatar
cn flag
The package linux-generic will ensure that kernels are automatically updated.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.