Is there a way to remove supported kernels no longer wanted?

Iacceptthelinuxchallenge

Gold Member
Gold Supporter
Joined
May 18, 2021
Messages
43
Reaction score
12
Credits
446
Like easily with a terminal prompt? I am tired of having to uncheck (The irritant.png) every time I need to update. o_O
 

Attachments

  • The irritant.png
    The irritant.png
    149.7 KB · Views: 126


Brickwizard

Well-Known Member
Joined
Apr 28, 2021
Messages
3,509
Reaction score
2,338
Credits
26,118
Try sudo apt autoremove --purge

it should remove most crud
 

Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
2,564
Reaction score
1,270
Credits
13,778
Here's a thread where I learned from Lord Boltar how to remove old kernels.

 

wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
8,148
Reaction score
7,035
Credits
31,500
Run a Timeshift snapshot before removing kernels.

Wiz
 

phanmetal

Member
Joined
Feb 22, 2022
Messages
47
Reaction score
18
Credits
349
Kernel list command on your device.
Code:
dpkg --get-selections | grep linux-image-
example output;
linux-image-4.4.0-21-generic install
linux-image-4.4.0-31-generic install

Code:
sudo apt purge linux-image-4.4.0-21-generic install

Don't delete the kernel you are using.
This command;
Code:
uname -a
will show you which kernel it is using.

Source; https://sudo.ubuntu-tr.net/eski-cekirdek-kernel-dosyalarini-temizleme
 
Last edited:
OP
I

Iacceptthelinuxchallenge

Gold Member
Gold Supporter
Joined
May 18, 2021
Messages
43
Reaction score
12
Credits
446
I assumed the 4.15 kernel is already deleted due to it no longer appearing in the attached screenshot. My issue is stated in the 1st discussion. Now I realize my original question should have been:
How to remove kernel update prompts from the Update Manager on kernels no longer installed?
 

Attachments

  • 4.15already removed.png
    4.15already removed.png
    177.6 KB · Views: 89

Brickwizard

Well-Known Member
Joined
Apr 28, 2021
Messages
3,509
Reaction score
2,338
Credits
26,118
When you click on each of the kernel's in the list [boxes on the left] you then get a list in the main box of all the variations of that kernel, if it says superseded or end of life it is not installed, if it says installed, and you don't want it, click on it and delete [WARNING make sure you do not delete every kernel listed as installed , or you will be in trouble]
the list is a full list of all available kernels for your distribution build, and is there for you to install an old discontinued kernel if you need to for some reason.
 

kc1di

Well-Known Member
Joined
May 14, 2021
Messages
1,446
Reaction score
1,259
Credits
10,381
If your using Mint then you can simply go to the update manager and uninstall which ever kernel you don't want then go to a terminal and type
Code:
sudo apt autoremove
To remove any dependencies that are not needed any more.
Or you can (Some would not agree) install ubuntu-cleaner from here.
It does a great job of removing old kernels but be careful with it.
 
OP
I

Iacceptthelinuxchallenge

Gold Member
Gold Supporter
Joined
May 18, 2021
Messages
43
Reaction score
12
Credits
446
If your using Mint then you can simply go to the update manager and uninstall which ever kernel you don't want then go to a terminal and type
Code:
sudo apt autoremove
To remove any dependencies that are not needed any more.
Or you can (Some would not agree) install ubuntu-cleaner from here.

It does a great job of removing old kernels but be careful with it.
Thanks for the reply. So its the dependencies are what is left and cause the Update Manager to continue to offer updates. The code you mentioned removes the dependencies, and thus no more unwanted updates...
When you click on each of the kernel's in the list [boxes on the left] you then get a list in the main box of all the variations of that kernel, if it says superseded or end of life it is not installed, if it says installed, and you don't want it, click on it and delete [WARNING make sure you do not delete every kernel listed as installed , or you will be in trouble]
the list is a full list of all available kernels for your distribution build, and is there for you to install an old discontinued kernel if you need to for some reason.
Thank you.
 

dos2unix

Well-Known Member
Joined
May 3, 2019
Messages
1,654
Reaction score
1,270
Credits
10,769

By default, three kernels are kept–the newest and two previous–when yum or dnf are used to perform upgrades. The number of kernels to be kept before the package manager erases them is configurable in the /etc/dnf/dnf.conf or /etc/yum.conf files. I usually change the installonly_limit value to 9 to retain a total of nine kernels. This has come in handy on a couple occasions when I had to revert to a kernel that was several versions down-level.

To me personally, the fact that I can keep old kernels to roll back to, is the best feature of Linux.
But it sounds like not all distro's support this.
 
$200 Digital Ocean Credit
Get a free VM to test out Linux!


Staff online

Members online


Top