Score:3

Why are there so many kernels on my system?

ar flag

Below is the list of the many installed images on my system. I do not know why there are so many. Why doesn't the autopurge argument take care of this mess? Please give me a reason why this is happening. Have I installed or enabled some settings without knowing? Thanks.

ii  linux-image-5.11.0-25-generic                 5.11.0-25.27~20.04.1                        amd64        Signed kernel image generic
ii  linux-image-5.11.0-27-generic                 5.11.0-27.29~20.04.1                        amd64        Signed kernel image generic
ii  linux-image-5.11.0-34-generic                 5.11.0-34.36~20.04.1                        amd64        Signed kernel image generic
ii  linux-image-5.11.0-36-generic                 5.11.0-36.40~20.04.1                        amd64        Signed kernel image generic
ii  linux-image-5.11.0-37-generic                 5.11.0-37.41~20.04.2                        amd64        Signed kernel image generic
ii  linux-image-5.11.0-38-generic                 5.11.0-38.42~20.04.1                        amd64        Signed kernel image generic
ii  linux-image-5.11.0-40-generic                 5.11.0-40.44~20.04.2                        amd64        Signed kernel image generic
ii  linux-image-5.11.0-41-generic                 5.11.0-41.45~20.04.1                        amd64        Signed kernel image generic
ii  linux-image-5.11.0-43-generic                 5.11.0-43.47~20.04.2                        amd64        Signed kernel image generic
rc  linux-image-5.4.0-66-generic                  5.4.0-66.74                                 amd64        Signed kernel image generic
rc  linux-image-5.4.0-66-lowlatency               5.4.0-66.74                                 amd64        Signed kernel image lowlatency
rc  linux-image-5.4.0-67-generic                  5.4.0-67.75                                 amd64        Signed kernel image generic
rc  linux-image-5.4.0-67-lowlatency               5.4.0-67.75                                 amd64        Signed kernel image lowlatency
rc  linux-image-5.4.0-70-generic                  5.4.0-70.78                                 amd64        Signed kernel image generic
rc  linux-image-5.4.0-70-lowlatency               5.4.0-70.78                                 amd64        Signed kernel image lowlatency
rc  linux-image-5.4.0-71-generic                  5.4.0-71.79                                 amd64        Signed kernel image generic
rc  linux-image-5.4.0-71-lowlatency               5.4.0-71.79                                 amd64        Signed kernel image lowlatency
rc  linux-image-5.4.0-72-generic                  5.4.0-72.80                                 amd64        Signed kernel image generic
rc  linux-image-5.4.0-72-lowlatency               5.4.0-72.80                                 amd64        Signed kernel image lowlatency
rc  linux-image-5.4.0-73-generic                  5.4.0-73.82                                 amd64        Signed kernel image generic
rc  linux-image-5.4.0-73-lowlatency               5.4.0-73.82                                 amd64        Signed kernel image lowlatency
rc  linux-image-5.4.0-74-generic                  5.4.0-74.83                                 amd64        Signed kernel image generic
rc  linux-image-5.4.0-74-lowlatency               5.4.0-74.83                                 amd64        Signed kernel image lowlatency
rc  linux-image-5.4.0-77-generic                  5.4.0-77.86                                 amd64        Signed kernel image generic
rc  linux-image-5.4.0-77-lowlatency               5.4.0-77.86                                 amd64        Signed kernel image lowlatency
rc  linux-image-5.4.0-80-generic                  5.4.0-80.90                                 amd64        Signed kernel image generic
rc  linux-image-5.4.0-80-lowlatency               5.4.0-80.90                                 amd64        Signed kernel image lowlatency
rc  linux-image-5.4.0-81-generic                  5.4.0-81.91                                 amd64        Signed kernel image generic
rc  linux-image-5.4.0-81-lowlatency               5.4.0-81.91                                 amd64        Signed kernel image lowlatency
rc  linux-image-5.8.0-50-generic                  5.8.0-50.56~20.04.1                         amd64        Signed kernel image generic
rc  linux-image-5.8.0-53-generic                  5.8.0-53.60~20.04.1                         amd64        Signed kernel image generic
rc  linux-image-5.8.0-55-generic                  5.8.0-55.62~20.04.1                         amd64        Signed kernel image generic
rc  linux-image-5.8.0-59-generic                  5.8.0-59.66~20.04.1                         amd64        Signed kernel image generic
rc  linux-image-5.8.0-63-generic                  5.8.0-63.71~20.04.1                         amd64        Signed kernel image generic
ii  linux-image-generic-hwe-20.04* 
heynnema avatar
ru flag
Only the "ii" packages are installed. The "rc" packages are leftover config files. You can purge all of those if you wish.
Score:2
nu flag

The reason is pretty simple: You can actually boot an older version, if you experience any kind of hiccups, regressions. While Ubuntu hides the boot menu by default, you can press a key to see it before you actually boot, and then you can pick a different version.

If you type: sudo apt-get autoremove, your system will let you remove all these packages at once. If you use a newer Ubuntu (such as 20.04 LTS), you can also use sudo apt autoremove, they are the same practically the same thing.

You can check out the /etc/apt/apt.conf.d/01autoremove-kernels file where apt stores the relevant lines. Don't touch the file though, it's auto-generated after each new kernel install.

Ps.: Only the ii packages are actually installed, as heynnema stated in comments.

Score:2
gh flag

Some of them are already removed:

rc  linux-image-5.4.0-81-lowlatency               5.4.0-81.91                                 amd64        Signed kernel image lowlatency
rc  linux-image-5.8.0-50-generic                  5.8.0-50.56~20.04.1                         amd64        Signed kernel image generic
rc  linux-image-5.8.0-53-generic                  5.8.0-53.60~20.04.1                         amd64        Signed kernel image generic
rc  linux-image-5.8.0-55-generic                  5.8.0-55.62~20.04.1                         amd64        Signed kernel image generic
rc  linux-image-5.8.0-59-generic                  5.8.0-59.66~20.04.1                         amd64        Signed kernel image generic
rc  linux-image-5.8.0-63-generic                  5.8.0-63.71~20.04.1  

But have remaining configuration files in your system.

For explanation see: explanation

To remove the remaining configuration files of the deinstalled packages, run:

sudo apt purge $(dpkg -l | egrep '^rc' | awk '{print $2}')

Explanation:

  • apt purge: Completely remove the package along with all of its configuration files.

  • $(dpkg -l | egrep '^rc' | awk '{print $2}'): dpkg -l filter lines that are beginning with rc

  • awk '{print $2}': It will print the second field of the lines (where there are the names of the packages).

For future, use autopurge instead of autoremove, so you have no leftover configuration files:

sudo apt autopurge 
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.