Removing old kernels - how many to keep?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
br1anstorm
Level 4
Level 4
Posts: 392
Joined: Mon Nov 24, 2014 8:53 am

Removing old kernels - how many to keep?

Post by br1anstorm »

I am running Mint 19.1 XFCE on my Samsung RF511 laptop (8GB RAM, Intel Core i5 2.50 GHz CPU, 750 GB HDD). Not the latest and fastest laptop, but it works well. I'm in no rush to move to Mint 20. I am conscientious about updating, and of course the Software Manager now automatically includes and recommends kernel updates.

I just did the latest update. It included the latest recommended kernel for my setup, which is 4.15.0-109.

Just for interest, I had a look at the list of previous kernels. There were no less than 13 older ones, starting with 4.15.0-20 and then listing almost every kernel-upgrade from 4.15.0-55 onwards.

The guide and advice offered on the website of the very wise Pjotr suggests that more than one redundant kernel is superfluous. He also recommends activating the 'automatic kernel removal' option (which keeps just one old one as a backup). I like to err on the side of caution. Occasionally I have tried booted using various earlier kernels when trying to overcome sporadic wifi connection problems. But keeping more than a dozen does seem like overkill.

So should I remove most of them? They may take up storage space, but do they affect (=slow down) the operation of the system?

cliffcoggin
Level 6
Level 6
Posts: 1045
Joined: Sat Sep 17, 2016 6:40 pm
Location: England

Re: Removing old kernels - how many to keep?

Post by cliffcoggin »

One old kernel should be the minimum. More than that is your choice. Bear in mind they take up quite a bit of space.
Cliff Coggin

User avatar
LanceM
Level 9
Level 9
Posts: 2797
Joined: Sun Jul 08, 2018 11:50 pm

Re: Removing old kernels - how many to keep?

Post by LanceM »

I'd use Pjor's advice. As long as the previous one works, it's enough.

Code: Select all

sudo apt-get autoremove
will remove them, or you can use the Update Manager to remove them one at a time.
To mark this issue solved, go to your original 1st post and click the edit pencil and add [Solved] at the beginning of the title and click Submit.
Mint accepts donations: https://linuxmint.com/donors.php

sleeper12
Level 11
Level 11
Posts: 3536
Joined: Thu May 25, 2017 3:22 pm

Re: Removing old kernels - how many to keep?

Post by sleeper12 »

You really shouldn't need more than 2 kernels, the current one & a backup. Having more than that is going to eat up your disk space. If you ever need a different kernel, just install it again.

User avatar
deck_luck
Level 5
Level 5
Posts: 825
Joined: Mon May 27, 2019 6:57 pm
Location: R-4808 North

Re: Removing old kernels - how many to keep?

Post by deck_luck »

br1anstorm wrote:
Sat Jul 11, 2020 12:31 pm
I am running Mint 19.1 XFCE on my Samsung RF511 laptop (8GB RAM, Intel Core i5 2.50 GHz CPU, 750 GB HDD). Not the latest and fastest laptop, but it works well. I'm in no rush to move to Mint 20. I am conscientious about updating, and of course the Software Manager now automatically includes and recommends kernel updates.

You are wise. There is no reason to upgrade to the next major or minor version if your existing OS version provides everything you need as long as you are still getting security updates. I think some people have nothing better to do with a computer than tinker with the desktop settings and install the next version of the OS. If they enjoy that more power to them. The more ambiguous beta testers the better for the next major release.

br1anstorm wrote:
Sat Jul 11, 2020 12:31 pm
I just did the latest update. It included the latest recommended kernel for my setup, which is 4.15.0-109.

Just for interest, I had a look at the list of previous kernels. There were no less than 13 older ones, starting with 4.15.0-20 and then listing almost every kernel-upgrade from 4.15.0-55 onwards.
...
So should I remove most of them? They may take up storage space, but do they affect (=slow down) the operation of the system?

The kernels are taking up space for sure, and they have no effect on the active kernel. I keep a very old kernel, most recent previous , and the active kernel. The Update Manger->View->Linux kernels->Remove old kernels has a nice user friendly interface to selectively clean up the kernels.
🐧Linux Mint 19 XFCE 💡Give a friend a fish, and you feed them for a day. Teach a friend how to fish, and you feed them for a lifetime. ✝️ Proverbs 4:7 Wisdom is the principal thing; therefore get wisdom: and with all thy getting get understanding.

1NEWLINUXUSER
Level 4
Level 4
Posts: 287
Joined: Sun Aug 25, 2019 8:58 am

Re: Removing old kernels - how many to keep?

Post by 1NEWLINUXUSER »

Ok, great, just when I thought I sorta had a reasonable understanding of what and how many kernels should or shouldn't be kept and/or deleted, here we go with this kernel thing again!

My system now shows that there are 40+ kernels spread out between 4.18 and 5.4 and no less than 40+ below the currently active 4.15.0-109, starting at 4.15.0-20 same as br1anstorm. All, with the exception of 4.15.0-108 & 109, are all labeled either Superseded or End Of Life.

My understanding is that anything marked Active or Installed are the only ones taking up disk space and all the Supercededs & EOLs are just there in name only using no disk space. So, can someone please confirm for me, are Supercededs & EOLs taking up disk space or not! If so, how do I get rid of them? Clicking on any Superseded or EOL kernel allows them ONLY to be installed but NOT removed! The only two that allow for removal are currently active & installed, 4.15.0.108 & 109!

As I have absolutely no intention of ever using anything other than LTS 4.15 what ever, I would like to delete any and all useless kernels that are taking up disk space on my computer. I have Update Manager Preferences set to Auto Maintenance so as to remove Obsolete kernels but the list just seems to keep growing, nothing ever seem to go away!

Any advise or questions are appreciated, thanks!

sleeper12
Level 11
Level 11
Posts: 3536
Joined: Thu May 25, 2017 3:22 pm

Re: Removing old kernels - how many to keep?

Post by sleeper12 »

The only ones taking up space are the installed & active ones, no need to worry about the others. If you want to free up some more space, run;

Code: Select all

 sudo apt autoremove 

User avatar
deck_luck
Level 5
Level 5
Posts: 825
Joined: Mon May 27, 2019 6:57 pm
Location: R-4808 North

Re: Removing old kernels - how many to keep?

Post by deck_luck »

Only the Installed or Active reside in your root file system. If you hit the Remove old kernels button, it display a list of candidates to remove. They will only be the active or installed kernels.
🐧Linux Mint 19 XFCE 💡Give a friend a fish, and you feed them for a day. Teach a friend how to fish, and you feed them for a lifetime. ✝️ Proverbs 4:7 Wisdom is the principal thing; therefore get wisdom: and with all thy getting get understanding.

User avatar
Pierre
Level 20
Level 20
Posts: 10599
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: Removing old kernels - how many to keep?

Post by Pierre »

when removing any of the Linux Kernels,
the very 1st kernel in any series is kept, for compatibility reasons,
as well as the latest kernel, and sometimes even, the second latest kernel, as well.

thus, all the other Linux Kernels .. can be safely removed.

Code: Select all

 sudo apt autoremove 
is one way, to remove those other Linux Kernels.

also, in the LM20 series, and within the Update Manager, there is an Automation option,
that is under Preferences, that will also Auto-Remove those older Linux Kernels.
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.

1NEWLINUXUSER
Level 4
Level 4
Posts: 287
Joined: Sun Aug 25, 2019 8:58 am

Re: Removing old kernels - how many to keep?

Post by 1NEWLINUXUSER »

Thank you all for the response! So I guess I'm good then as 4.15.0-109 is Active and 108 is Installed. If I click on the Remove button it shows 108 as the only one that can be removed but I'll keep it as other suggest. I just hate computer clutter and hate seeing all those useless kernels listed there doing nothing. But, as long as they aren't using disk space I guess I can live with it. But, that's just me! :oops:
Thanks again.

User avatar
LanceM
Level 9
Level 9
Posts: 2797
Joined: Sun Jul 08, 2018 11:50 pm

Re: Removing old kernels - how many to keep?

Post by LanceM »

If you hate clutter, have you done cleanup? Special attention to section 10 https://easylinuxtipsproject.blogspot.c ... -mint.html
To mark this issue solved, go to your original 1st post and click the edit pencil and add [Solved] at the beginning of the title and click Submit.
Mint accepts donations: https://linuxmint.com/donors.php

Petermint
Level 6
Level 6
Posts: 1068
Joined: Tue Feb 16, 2016 3:12 am

Re: Removing old kernels - how many to keep?

Post by Petermint »

Deleting a kernel removes about 300 MB. Deleting an unused KDE based application can free up 500 MB. I keep a little list of cleanups to do once per month. For kernels, I keep at least a month of updates because some do not work with devices I plug in occasionally.

1NEWLINUXUSER
Level 4
Level 4
Posts: 287
Joined: Sun Aug 25, 2019 8:58 am

Re: Removing old kernels - how many to keep?

Post by 1NEWLINUXUSER »

LanceM wrote:
Mon Jul 13, 2020 5:43 pm
If you hate clutter, have you done cleanup? Special attention to section 10 https://easylinuxtipsproject.blogspot.c ... -mint.html
Used it early on when I first started using Linux, then forgot about it! Thanks for reminding me of it!

Petermint
Level 6
Level 6
Posts: 1068
Joined: Tue Feb 16, 2016 3:12 am

Re: Removing old kernels - how many to keep?

Post by Petermint »

That liked page is interesting. Similar to what I do. I tested the remove fonts. 124 MB saved. Less than one kernel.

Post Reply

Return to “Newbie Questions”