Allow Update Manager to remove several old kernels

Suggestions and feedback for Linux Mint and the forums
Forum rules
Do not post support questions here. Before you post read: Where to post ideas & feature requests
Post Reply
Bender72
Level 1
Level 1
Posts: 35
Joined: Mon Jul 18, 2016 8:22 pm

Allow Update Manager to remove several old kernels

Post by Bender72 »

It would be very convenient if several old kernels could be removed at the same time in Update Manager. Currently, Update Manager can only remove one at a time, and each time requires one to re-enter the root password.

I'm aware that there are already ways to do this:

viewtopic.php?t=234076
viewtopic.php?t=238519

but my point is usability. Kernels pile up over time, so wanting to remove several old ones is probably the most common use case, not the exception. Update Manager / Linux Kernels is the obvious place to look for this functionality because Update Manager is where you install new kernels.
MintBean

Re: Allow Update Manager to remove several old kernels

Post by MintBean »

Got to second this one. Would be a massive improvement and addresses a use case I suspect many will encounter.
User avatar
Pjotr
Level 23
Level 23
Posts: 19886
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: Allow Update Manager to remove several old kernels

Post by Pjotr »

Good idea. In the meantime, you can use this method:
https://sites.google.com/site/easylinux ... one-stroke
(item 7.1, right column)
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
User avatar
karlchen
Level 23
Level 23
Posts: 18177
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Allow Update Manager to remove several old kernels

Post by karlchen »

Of course, I will not object to improving Update Manager.

Yet, seems a bit as if not everyone is aware that already today, using Synaptic Package Manager, you can mark the kernel packages which you wish to uninstall and select "complete removal (purge)". In one go, password requested only once, before Synaptic is launched with root privileges.

This is what I have been doing since the times of Karmic Koala.
Whenever the number of installed kernels had grown to 6 or more, I have marked all the packages which belonged to the oldest 3 or 4 kernels and removed them from inside Synaptic Package Manager. Sample below.

Image
(Click screenshot to enlarge. Press <alt><cursor left> to return here.)
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 762 days now.
Lifeline
DGMurdockIII
Level 1
Level 1
Posts: 48
Joined: Wed Jul 29, 2009 5:07 pm

Re: Allow Update Manager to remove several old kernels

Post by DGMurdockIII »

This would be good if the update man is could do this
User avatar
majpooper
Level 8
Level 8
Posts: 2084
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

Re: Allow Update Manager to remove several old kernels

Post by majpooper »

Not to be a trouble maker but I would not be so quick to remove old kernels - for sure leave the last one prior to the updated one. IMHO it is probably a good thing not to make it so easy to remove old kernels in the update manager. I do get it that having an inordinate number of kernels takes some space. I often have six or so with no impact on performance or memory space issues.

Over a year or so ago I went through a an exercise to "clean up" my system to see how much space I would gain and if i would notice any performance gain. I cleaned out thumbnail cache, empty the trash, got rid of old kernels, cleaned out /tmp and /.cache in my home dir maybe a few other items that I looked into. The results were less than startling - I can't recall how much space I reclaimed but it maybe a few hundred KB - basically nothing. And no performance gain at all - nada, none. So why bother except for every few months just because . . . .?
User avatar
Schultz
Level 9
Level 9
Posts: 2935
Joined: Thu Feb 25, 2016 8:57 pm

Re: Allow Update Manager to remove several old kernels

Post by Schultz »

How about leaving the last two working kernels, in addition to the current one, then when installing a new one, remove the oldest? That way you would always only have three installed kernels. (I don't understand why anyone would let them pile up so much.) :?:

But to be on topic, I do agree it would be an improvement if the Update Manager could remove more than one at a time.
User avatar
Flemur
Level 20
Level 20
Posts: 10097
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Allow Update Manager to remove several old kernels

Post by Flemur »

karlchen wrote: Fri Jan 26, 2018 8:03 pmYet, seems a bit as if not everyone is aware that already today, using Synaptic Package Manager, you can mark the kernel packages which you wish to uninstall and select "complete removal (purge)".
I do that, but it's not as simple as it should be.

For example, to remove kernel 4.4.0-101 and the associated stuff, there is what - 3, 4 packages? You see in your picture that the 4.4.0-101 packages are spread around. So you search for "4.4.0-101" and remove those.

So --> It'd be nice if there were a "meta" package for each kernel.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
reggieb

Re: Allow Update Manager to remove several old kernels

Post by reggieb »

Schultz wrote: Mon Feb 12, 2018 4:54 pm How about leaving the last two working kernels, in addition to the current one, then when installing a new one, remove the oldest?
This would make things so much easier. My boot sector can only store about 6 kernels. So I regularly have to clear some out - it's a routine maintenance task, which I sometimes forget. It would be great if I could set how many old kernels I wanted to keep, and then have each kernel update maintain that. And as is evident from this post, I am not alone in this wish.
User avatar
karlchen
Level 23
Level 23
Posts: 18177
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Allow Update Manager to remove several old kernels

Post by karlchen »

reggieb wrote: Thu Dec 20, 2018 5:31 amMy boot sector can only store about 6 kernels.
This is not the boot sector, rather it is a dedicated filesystem, mounted under the name of /boot.
Note:
In case you had not created a dedicated filesystem for "boot", /boot would merely be a sub-directory of the root filesystem /.
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 762 days now.
Lifeline
DAMIEN1307

Re: Allow Update Manager to remove several old kernels

Post by DAMIEN1307 »

i believe that gm10 has been able to get that feature included in the newest LM 19.1 where in the update manager, in the linux kernels section, you should now find check mark boxes contained within, that now allow for multiple old kernel deletions all at once simply by filling the boxes with check marks for the kernels that one would want removed...thank gm10 when you see him next in the forums...lol...DAMIEN


scroll down till you see "A new button was added to make it easier to remove unused kernels:"

https://www.linuxmint.com/rel_tessa_cin ... atsnew.php
User avatar
Pjotr
Level 23
Level 23
Posts: 19886
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: Allow Update Manager to remove several old kernels

Post by Pjotr »

DAMIEN1307 wrote: Thu Dec 20, 2018 6:31 am i believe that gm10 has been able to get that feature included in the newest LM 19.1 where in the update manager, in the linux kernels section, you should now find check mark boxes contained within, that now allow for multiple old kernel deletions all at once simply by filling the boxes with check marks for the kernels that one would want removed...thank gm10 when you see him next in the forums...lol...DAMIEN


scroll down till you see "A new button was added to make it easier to remove unused kernels:"

https://www.linuxmint.com/rel_tessa_cin ... atsnew.php
Correct. See also this how-to with screenshots:
https://easylinuxtipsproject.blogspot.c ... html#ID9.1
(item 9.1)

And gm10 is indeed the guy to thank for that. :)
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
gm10

Re: Allow Update Manager to remove several old kernels

Post by gm10 »

There's another little undocumented change in LM19.1's Update Manager in that it forces you onto the kernel meta-package and keeps you there. One effect of that is that all kernels you automatically updated via Update Manager can also be removed via a simple

Code: Select all

apt autoremove --purge
This automatically keeps a previous version. I had also provided automation in Update Manager for that but that feature has not been approved by Clem yet and didn't make it into 19.1. Only kernels you install manually via the kernel window you always need to manually remove from the kernel window again. They will not be removed by the command above to allow you to keep a specific version.

Further in that respect Pjotr, you wrote on your linked site:
There's an important exception to this rule, which has to do with security. From Mint 19.2 onward, if you want to have a secure kernel, you'll need to upgrade your kernel pretty soon to a higher series. Or downgrade it to the 4.15 kernel series. That's because the short-lived kernel series with which Mint 19.2 and 19.3 will be released, will only be supported for a couple of months.
19.2+ won't automatically upgrade you to a higher series unless you clean install it. Nor will Update Manager, it will keep you on the 4.15 series unless you manually put it on the HWE kernel upgrade path, which you can do right now, if you want to, no need to wait for 19.2:

Code: Select all

apt install linux-generic-hwe-18.04
This will get you the 4.18 kernel series. Nobody should read this as a suggestion to actually run that command. You should stick with the 4.15 LTS kernel if it's all the same to you (see Pjotr's site for the explanation :D).

There's still some logic I want to add with respect to automatically offering to upgrade to the higher series tough. So far I was thinking along these lines: https://github.com/linuxmint/mintupdate/issues/440 - feel free to add to that should I have missed something and/or you disagree.
User avatar
Pjotr
Level 23
Level 23
Posts: 19886
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: Allow Update Manager to remove several old kernels

Post by Pjotr »

gm10 wrote: Thu Dec 20, 2018 7:53 am Further in that respect Pjotr, you wrote on your linked site:
There's an important exception to this rule, which has to do with security. From Mint 19.2 onward, if you want to have a secure kernel, you'll need to upgrade your kernel pretty soon to a higher series. Or downgrade it to the 4.15 kernel series. That's because the short-lived kernel series with which Mint 19.2 and 19.3 will be released, will only be supported for a couple of months.
19.2+ won't automatically upgrade you to a higher series unless you clean install it.
You're right. I'll make that text a bit clearer. :)
gm10 wrote: Thu Dec 20, 2018 7:53 amThere's still some logic I want to add with respect to automatically offering to upgrade to the higher series tough. So far I was thinking along these lines: https://github.com/linuxmint/mintupdate/issues/440 - feel free to add to that should I have missed something and/or you disagree.
Like you, I'm of the opinion that if your system is already running well on the LTS kernel, there's no need to board the HWE rollercoaster. So no notifications are needed then about a newer HWE kernel being available. In my opinion, such a notification would only be confusing and might lead to undesirable behaviour....

For completeness' sake (Gründlichkeit) I'll post this comment also on GitHub. :)
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
gm10

Re: Allow Update Manager to remove several old kernels

Post by gm10 »

Pjotr wrote: Thu Dec 20, 2018 11:35 am Like you, I'm of the opinion that if your system is already running well on the LTS kernel, there's no need to board the HWE rollercoaster. So no notifications are needed then about a newer HWE kernel being available. In my opinion, such a notification would only be confusing and might lead to undesirable behaviour....
I hear you and it's one of my concerns, but people are going to install them, anyway, so I think the minimum we need is to offer to install the HWE meta once an installed HWE kernel is detected to ensure they are being kept up to date. You could say "responsibility of the user" and you would be correct, but Mint caters to newbie users so we gotta save them from themselves at times. ;)

As far as I recall LM19 code the LM19 users will get 4.18 in their list of upgrades no matter what btw. At least I stopped that madness in LM19.1.
Post Reply

Return to “Suggestions & Feedback”