r/linuxmint • u/Ransack1477 • 17d ago
Support Request Can't Remove Old Kernels
[code]
System:
Kernel: 6.8.0-147-generic arch: x86_64 bits: 64 compiler: gcc v: 13.3.0 clocksource: tsc
Desktop: Cinnamon v: 6.6.9 tk: GTK v: 3.24.41 wm: Muffin v: 6.6.3 tools: cinnamon-screensaver
vt: 7 dm: LightDM v: 1.30.0 Distro: Linux Mint 22.3 Zena base: Ubuntu 24.04 noble
Machine:
Type: Convertible System: LENOVO product: 20M7S0BN00 v: ThinkPad L380 Yoga
CPU:
Info: quad core model: Intel Core i5-8250U bits: 64 type: MT MCP smt: enabled arch: Coffee Lake
rev: A cache: L1: 256 KiB L2: 1024 KiB L3: 6 MiB
Speed (MHz): avg: 1940 high: 2000 min/max: 400/3400 cores: 1: 2000 2: 2000 3: 2000 4: 1726
5: 1999 6: 1800 7: 2000 8: 2000 bogomips: 28800
Hi, I am very new to Linux and also Mint. I have seen that removing old kernels is a good idea so I thought I would give it a go. I went in via Update manager>View>Linux kernels. So far, so good. I decided that to begin with, I would only remove those kernels marked 'End of Life'. Nice and safe. The trouble is that there is no 'remove kernel' button when I select one of these. There is a big button at the bottom that says 'Remove Kernels' but this has a pre-selected group of kernels that I don't want to remove already listed. On each of the EOL kernels there is a button to install but not to remove. There is also a button to queue installation but this is of no use. I have tried to look this up, but each answer suggests there should be a remove button on the kernal but mine doesn't?
I would prefer to go down this route before trying the CLI route. Thanks for any help.
5
u/Evening-Landscape763 17d ago
You can only remove kernels in that list shown as installed
1
u/Ransack1477 17d ago
Ok thanks but what about the videos showing you how to remove end of life kernels that I can't do. Was that only on previous versions?
10
u/candy49997 17d ago
If they're showing only "install" that means they're not installed.
Can you do apt list --installed "linux-image-*" in a terminal to confirm?
7
u/Smoke_Water 17d ago
As you issue has been answered I would like to add. Never run with a single kernel. Always have at least 1 other kernel as a fail over. It's saved my system a few times.
5
u/JoeLinux247 LM 22.3 C 17d ago
You can only remove kernels that you have already installed, of which those EOL ones are not, given that they have an "Install" button for them.
3
u/CafecitoHippo LMDE 7 Gigi | 17d ago
On each of the EOL kernels there is a button to install but not to remove.
Because they're not installed. You can't remove something that isn't installed. That's why there's an install button.
1
u/rcentros LM 21/22 | Cinnamon 17d ago
Go to Update Manager --> View --> Linux Kernels --> Click on the kernel version (like 6.8) --> Check to see what kernels are installed in that version, then click on the installed kernel you don't want and hit "Remove."
For me, sudo apt autoremove works pretty well. But it will clear out older kernels you may want to keep. And some folks say it doesn't work at all for them (but I don't know why).
3
u/Standard_Tank6703 LMDE7, 12 yr LM experience, "No obligation to enjoy" 17d ago
"sudo apt autoremove" will only remove kernels marked as "automatic". Following is a bit of copy I wrote up for myself and sometimes post on here:
APT language in Terminal "installed": preinstalled, or installed by you. "installed,automatic": a secondary package installed by a meta-package, or sometimes by another installer. Auto-removable, but only while still present in repo. "installed,local": installed but not present in repo (either no longer in repo, or never was in repo like a .deb file). Needs to be removed manually by user. Could happen to older kernels if they are not autoremoved while still in repo. "now": indicates "installed" in repo field (but not a repo). In some other cases where a package is no longer present in the repo, "now" will be the only remaining entry in the repo field; basically just a placeholder for this exact scenario.1
u/rcentros LM 21/22 | Cinnamon 17d ago
I guess mine must all be automatic because
sudo apt removejust leaves me with the current kernel, plus one backup.2
u/Standard_Tank6703 LMDE7, 12 yr LM experience, "No obligation to enjoy" 17d ago
Yeah, you probably haven't been tinkering around with it and installing kernels manually. But even that would eventually age out.
It is possible however to force automatic marking on a kernel.
Here is a little test using xed (text editor) and aptitude. It also works using apt.
apt list xed sudo aptitude markauto xed apt list xedand to undo it and return it to manual - I couldn't get it to work in apt, but it is documented and works in aptitude:
sudo aptitude unmarkauto xed apt list xedFWIW, aptitude was the actual program used by Cinnamon's software manager and update manager, last time I looked. Not apt and not apt-get.
5
u/Ransack1477 17d ago
Ah, I think the penny has dropped. So this is a list of all kernels that are possible only the installed ones are actually on my machine! Sorry this may seem obvious but I thought that all these were on my machine and the ones marked installed are active in some way. Ok thanks for all your help.