How do I delete old kernels?

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
m654321

How do I delete old kernels?

Post by m654321 »

Recently, I updated LMint cinnamon with the latest kernel using command line as follows:

Code: Select all

sudo apt-get update
sudo apt-get install linux-generic 
How do I delete the old kernel(s)?

Mike
User avatar
Pjotr
Level 24
Level 24
Posts: 20116
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: How do I delete old kernels?

Post by Pjotr »

m654321 wrote:Recently, I updated LMint cinnamon with the latest kernel using command line as follows:

Code: Select all

sudo apt-get update
sudo apt-get install linux-generic 
How do I delete the old kernel(s)?

Mike
That's the wrong approach in several fundamental ways. You should only install newer kernels by means of Update Manager, or by means of the kernel tool that's accessible in Update Manager. That very tool is also the thing you should use for removing older kernels.

Update Manager - panel: View - Linux kernels

Remove that generic package that you've installed, and its dependencies, like this:

Code: Select all

sudo apt-get remove linux-generic linux-image-generic linux-headers-generic
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.
m654321

Re: How do I delete old kernels?

Post by m654321 »

Pjotr wrote:Recently, I updated LMint cinnamon with the latest kernel using command line as follows:
That's the wrong approach in several fundamental ways. You should only install newer kernels by means of Update Manager, or by means of the kernel tool that's accessible in Update Manager. That very tool is also the thing you should use for removing older kernels.

Update Manager - panel: View - Linux kernels

Remove that generic package that you've installed, and its dependencies, like this:

Code: Select all

sudo apt-get remove linux-generic linux-image-generic linux-headers-generic
@Pjotr...
Many thanks for pointing out my error.
Using Update Manager, are the old kernels removed automatically when I install the new kernel?

Mike
User avatar
Moem
Level 22
Level 22
Posts: 16233
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: How do I delete old kernels?

Post by Moem »

m654321 wrote:Using Update Manager, are the old kernels removed automatically when I install the new kernel?
No, they are not, they remain in place. There is a button on the update manager that lists the kernels that are available for install and also shows which ones you have installed but not loaded, and you can remove them from there.
View => Linux Kernels should get you there.
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!
User avatar
Pierre
Level 21
Level 21
Posts: 13222
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: How do I delete old kernels?

Post by Pierre »

from time to time, I've removed those older kernels,
by using Package Manager AKA synaptic.

you can easily recover 4 - 5 Gb of disk space,
after removing those older kernels.
:shock:
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!.
Mintstant Karma
Level 4
Level 4
Posts: 314
Joined: Thu Nov 07, 2013 2:01 pm

Re: How do I delete old kernels?

Post by Mintstant Karma »

"you can easily recover 4 - 5 Gb of disk space,
after removing those older kernels."


Ha! I've only recently begun looking into this topic, and found I had about thirty old kernels installed! Just today I started deleting, and with just the first two removals I've recovered 1.1 GB.

If that's typical I expect I could easily recover 28 GB! Wow.
User avatar
Moem
Level 22
Level 22
Posts: 16233
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: How do I delete old kernels?

Post by Moem »

Mintstant Karma wrote: Mon Dec 06, 2021 3:18 pm Ha! I've only recently begun looking into this topic, and found I had about thirty old kernels installed! Just today I started deleting, and with just the first two removals I've recovered 1.1 GB.
Just so you know: this topic is years old, and the information is outdated (which is why I will lock it after posting this). The Update Manager in the current versions of Mint gives you some nice new options:
- queue kernels for deletion, and then remove them all in one go
- automate removal of old kernels (your currently loaded kernel + one previous one as a spare will always be kept).

Enjoy the new features, and your reclaimed space!
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!
Locked

Return to “Software & Applications”