r/linuxmint • • 14d ago

SOLVED /boot full cannot delete kernels

/boot full cannot delete kernels. From Update Manager I get:

The package system is broken

The following packages have unmet dependencies:

linux-image-generic: Depends: linux-image-6.8.0-149-generic but it is not installed

I have tried all sorts of things within terminal (as per help on Linux forms not here) and they ALL fail. sdb1 (/boot) has 999mb and says it's 100% full.

sudo apt autoremove --purge

Tried manully as well, that one AND another separately. No joy.

Using Cinnamon Mint 22.2

HELP

EDIT: Used timeshift (from ages ago) then was able to manually remove each kernel via Terminal after that.

Got sick of going round in circles, error after error, /boot was 100% and now is 27% full. Hell of a difference from a few kernels but never mind, all sorted and will watch it from now on.

1 Upvotes

23 comments sorted by

5

u/-Sturla- 14d ago

Check what kernel you're actually running (cat /proc/version) and manually delete the older ones in /boot with sudo rm /boot/*versionnumber*
Most systems are set up to keep the last N kernels for the ability to go back if something breaks, so autoremove won't remove all of them.

1

u/ClimateTraditional40 14d ago

It doesn't let me!!!

4

u/-Sturla- 14d ago

sudo won't let you delete files in /boot?
Ok, run "sudo su -" type your password, then run "cat /proc/version", mark the version and run "ls -lh /boot"
It should give you a list of files.
Pick a version that's older than the one you're running, then run
"rm /boot/*6.8.<version>*"
If that fails copy the output here.
I've never been denied deleting old kernels in /boot as root.

1

u/ClimateTraditional40 14d ago

No, I just got a new set of errors on trying.

1

u/-Sturla- 13d ago

Without the errors it's not easy trying to help.

3

u/DannoXYZ 14d ago

Post screenshot of commands you're running and any errors you're getting.

2

u/chuggerguy Linux Mint 22.3 Zena | MATÉ 14d ago

Do what u/-Sturla- says.

I have three kernels right now which is one more than I usually keep.

root@asus2:/home/chugger/desktop# find /boot -iname vmlinuz-*
/boot/vmlinuz-7.0.0-42-generic
/boot/vmlinuz-7.0.0-34-generic
/boot/vmlinuz-7.0.0-43-generic
root@asus2:/home/chugger/desktop# sudo du -hxcd 1 /boot
8.3M/boot/grub
343M/boot
343Mtotal

If you have a GB for /boot and it's full, you likely have several old ones you can remove.

Good luck.

1

u/couriousLin 14d ago

I haven't had an issue deleting old kernels so you must have something strange going on with your system. I'm assuming df -h shows /boot at > 95%. Run these commands:

#current running kernel 
uname -r
#installed kernels and headers
dpkg --list | grep linux-image && ls /usr/src | grep linux-headers

Hopefully you still have your bootable mint USB handy. Boot from the live USB and run a filesystem check (e2fsck -fv) on all your partitions. You may need to unmount them before running the fsck. Once they're checked out, mount your / filesystem and carefully delete the old config and initrd.img files in /boot. You'll still need to use sudo to delete the files.

1

u/ClimateTraditional40 14d ago

100%.

I spent ages messing about. Yes I have a USB boot device. I gave up and timeshifted system back in the end and then was able to delete , one by one, via terminal, the pesky things.

I see newer versions will have a built in auto remove for unneeded kernels, time to upgrade I thnk.

Thanks people.

1

u/couriousLin 13d ago

Great to hear you have things back. haha I almost mentioned Timeshift but assumed you didn't use it. It's worked well for me when my "brilliance" got me into trouble.

While i have the kernel maintenance set, I still run uname and dpkg commands above after a kernel update. Occasionally check that /boot and /lib/modules only have the relevant kernels.

Yeah, I usually keep current with Mint and with Mint 27 around the corner, you have a choice to incrementally upgrade to 23 before 27, or a clean install straight to 27.

1

u/ClimateTraditional40 13d ago

Well I like to fix things if possible before roll backs or last resort, reinstall. Seems crazy I caouldn't remove something because the partition was full. I would normally wait and go to 27...but if there is auto remove old kernels, well maybe I should upgrade sooner. Seeing the hassle I had!!

1

u/couriousLin 12d ago

Yeah, fixing the issue is a good practice, I'm curious, how many old kernels did you remove? Thinking back, Isn't kernel maintenance available in Mint 22.2 (update manager > settings >maintenance? Admittedly, I seem to remember there was an issue with it not removing my old kernels.

1

u/ClimateTraditional40 12d ago

I forget, 6 ish? I think? or 8. Yes I googled and apparently I need to upgrade for auto remove.

Yes in Update Manager you can - normally - remove them but thats where the errors started. Went on to terminal and various fixes and round and round in circles....grrr...

1

u/couriousLin 11d ago

I'm confused, I had to boot up Mint 22.2 to check. From Update Manager (mintupdate) > Edit > Preferences [Automation] you don't have Automatic Kernel maintenance?

1

u/ClimateTraditional40 11d ago

Its been ON for ages.

So much for that

1

u/_ElBee_ 14d ago

You have f***ed up something somewhere. Make backups of your important stuff and re-install Mint.

2

u/ClimateTraditional40 14d ago

Hah, yes last resort. I was considering it. I timeshifted back in the end and was THEN able to remove the annoying kernels. Was surprised how much room that freed up. From 100% full to now 27% full.

Will upgrade to 22.3 I think next.

Normally I don't bother with the in between upggrades, just like 21 to 22 and so on, but it says auto remove kernels bilit in so yeah sounds good.

1

u/_ElBee_ 13d ago

Good to read you resolved the issue! 👍

1

u/ClimateTraditional40 13d ago

Thanks, yes. Geez crazy though all these mad errors from just trying to remove something!

Still, I DO like Linux, haven't missed Windows in years...(I used to be a big gamer once hence Windows back when)

1

u/-Sturla- 12d ago

Even my gaming rig runs Linux, these days.
Games that doesn't require a root kit kernel level anti-cheat mostly just works. Give it a go if you miss gaming.

1

u/ClimateTraditional40 12d ago

I am aware. Had Steam on Linux. But...it's not the same, not high end graphics FPS anyway. Expensive way to game really, son still does, must admit I get jealous seeing the graphics these days...but nah.
If I cared enough I'd get a console.

1

u/Monoyo- 14d ago

what's the output of uname -r and ls /boot? apt usually cant remove old kernels once /boot is already 100% full, so you have to drop an older linux-image with dpkg first, just not the one you're booted into, then sudo apt -f install can finish the stuck 6.8.0-149 install.