Allow Update Manager to remove several old kernels

Write suggestions and new ideas in here
More ideas here http://community.linuxmint.com/idea/welcome
Forum rules
  • Only post ideas here that are specifically about the Linux Mint distribution or its websites.
  • So that developers and users from any distribution can discuss ideas in one place, post ideas about improving software to the collaboration website for that software instead.
Post Reply
Bender72
Level 1
Level 1
Posts: 22
Joined: Mon Jul 18, 2016 8:22 pm

Allow Update Manager to remove several old kernels

Post by Bender72 » Fri Jan 26, 2018 7:03 pm

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.

User avatar
MintBean
Level 9
Level 9
Posts: 2968
Joined: Fri Aug 07, 2015 6:54 am
Location: Blighty

Re: Allow Update Manager to remove several old kernels

Post by MintBean » Fri Jan 26, 2018 7:15 pm

Got to second this one. Would be a massive improvement and addresses a use case I suspect many will encounter.

User avatar
Pjotr
Level 20
Level 20
Posts: 11179
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 » Fri Jan 26, 2018 7:17 pm

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 19.1 Tessa
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 19
Level 19
Posts: 9690
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Allow Update Manager to remove several old kernels

Post by karlchen » Fri Jan 26, 2018 8:03 pm

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
Linux Mint 18.1 64-bit Cinnamon Desktop, Total Commander 9.21a 64-bit
Ubuntu 18.04.1 32-bit Mate Desktop, Total Commander 9.21a 32-bit
Windows? - 1 window in every room

DGMurdockIII
Level 1
Level 1
Posts: 43
Joined: Wed Jul 29, 2009 5:07 pm

Re: Allow Update Manager to remove several old kernels

Post by DGMurdockIII » Mon Feb 12, 2018 2:35 pm

This would be good if the update man is could do this

User avatar
majpooper
Level 5
Level 5
Posts: 710
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

Re: Allow Update Manager to remove several old kernels

Post by majpooper » Mon Feb 12, 2018 3:52 pm

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 6
Level 6
Posts: 1425
Joined: Thu Feb 25, 2016 8:57 pm

Re: Allow Update Manager to remove several old kernels

Post by Schultz » 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? 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 16
Level 16
Posts: 6339
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Allow Update Manager to remove several old kernels

Post by Flemur » Mon Feb 12, 2018 6:36 pm

karlchen wrote:
Fri Jan 26, 2018 8:03 pm
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)".
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?
Manjaro openbox/fluxbox/pulse-less
Lubuntu LXDE/fluxbox/pulse-less

reggieb
Level 1
Level 1
Posts: 5
Joined: Thu Feb 27, 2014 8:45 am

Re: Allow Update Manager to remove several old kernels

Post by reggieb » Thu Dec 20, 2018 5:31 am

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 19
Level 19
Posts: 9690
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Allow Update Manager to remove several old kernels

Post by karlchen » Thu Dec 20, 2018 5:55 am

reggieb wrote:
Thu Dec 20, 2018 5:31 am
My 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
Linux Mint 18.1 64-bit Cinnamon Desktop, Total Commander 9.21a 64-bit
Ubuntu 18.04.1 32-bit Mate Desktop, Total Commander 9.21a 32-bit
Windows? - 1 window in every room

DAMIEN1307
Level 6
Level 6
Posts: 1388
Joined: Tue Feb 21, 2017 8:13 pm
Location: Alamogordo, New Mexico, USA

Re: Allow Update Manager to remove several old kernels

Post by DAMIEN1307 » 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
ORDO AB CHAO

User avatar
Pjotr
Level 20
Level 20
Posts: 11179
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 » Thu Dec 20, 2018 6:45 am

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 19.1 Tessa
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.

gm10
Level 14
Level 14
Posts: 5240
Joined: Thu Jun 21, 2018 5:11 pm

Re: Allow Update Manager to remove several old kernels

Post by gm10 » Thu Dec 20, 2018 7:53 am

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 20
Level 20
Posts: 11179
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 » Thu Dec 20, 2018 11:35 am

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 am
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.
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 19.1 Tessa
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.

gm10
Level 14
Level 14
Posts: 5240
Joined: Thu Jun 21, 2018 5:11 pm

Re: Allow Update Manager to remove several old kernels

Post by gm10 » Thu Dec 20, 2018 11:53 am

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 & New Ideas”