Registered Member
|
There are lots of posts about removing old kernels automatically on Ubuntu yet I have found nothing that works .
'apt-get autoremove --purge' does nothing . here is what I have dpkg --list | grep linux-image ii linux-image-5.4.0-52-generic 5.4.0-52.57 amd64 Signed kernel image generic ii linux-image-5.4.0-53-generic 5.4.0-53.59 amd64 Signed kernel image generic ii linux-image-5.4.0-54-generic 5.4.0-54.60 amd64 Signed kernel image generic ii linux-image-5.4.0-56-generic 5.4.0-56.62 amd64 Signed kernel image generic ii linux-image-generic 5.4.0.56.59 amd64 Generic Linux kernel image no kernels are removed after a new kernel install ? |
Registered Member
|
|
Registered Member
|
does nothing
myuser@linux-desktop:~$ ls /boot config-5.4.0-52-generic grub initrd.img-5.4.0-56-generic System.map-5.4.0-52-generic vmlinuz-5.4.0-52-generic config-5.4.0-53-generic initrd.img initrd.img.old System.map-5.4.0-53-generic vmlinuz-5.4.0-53-generic config-5.4.0-54-generic initrd.img-5.4.0-52-generic memtest86+.bin System.map-5.4.0-54-generic vmlinuz-5.4.0-54-generic config-5.4.0-56-generic initrd.img-5.4.0-53-generic memtest86+.elf System.map-5.4.0-56-generic vmlinuz-5.4.0-56-generic efi initrd.img-5.4.0-54-generic memtest86+_multiboot.bin vmlinuz vmlinuz.old myuser@linux-desktop:~$ sudo apt autoremove --purge -y [sudo] password for myuser: Reading package lists... Done Building dependency tree Reading state information... Done Starting pkgProblemResolver with broken count: 0 Starting 2 pkgProblemResolver with broken count: 0 Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. myuser@linux-desktop:~$ ls /boot config-5.4.0-52-generic grub initrd.img-5.4.0-56-generic System.map-5.4.0-52-generic vmlinuz-5.4.0-52-generic config-5.4.0-53-generic initrd.img initrd.img.old System.map-5.4.0-53-generic vmlinuz-5.4.0-53-generic config-5.4.0-54-generic initrd.img-5.4.0-52-generic memtest86+.bin System.map-5.4.0-54-generic vmlinuz-5.4.0-54-generic config-5.4.0-56-generic initrd.img-5.4.0-53-generic memtest86+.elf System.map-5.4.0-56-generic vmlinuz-5.4.0-56-generic efi initrd.img-5.4.0-54-generic memtest86+_multiboot.bin vmlinuz vmlinuz.old |
Registered Member
|
Strange, yes you are right. The autoremove looks likes broken. I've removed all via synaptic.
linux-image-xxx linux-modules-xxx linux-modules-extra-xxx |
Registered Member
|
This issue is present in current ubuntu and hence KDE Neon installations and is due to kernels being marked as manually installed. I found a command on the web that corrects this issue by marking all kernels as auto installed:
|
Registered Member
|
@dbergstein: Thanks so much for sharing this.
Nice time saver for this annoying circumstance to manually remove linux-headers, linux-image, linux-modules, linux-modules-extra and linux-tools packages for each obsolete kernel before or after almost each distributed kernel update. Especially if storage technically one's /boot partition can only hold three 5.x kernels, so an 'apt autoremove' covering the removal of unused kernels becomes kind of a duty. My system was partitioned via kubuntu 15.04 setup before in-place migrating to the first KDE Neon version more than 3 years ago. And hell yeah, 512 MB as /boot partition for the 3.19.x kernel was definitely sufficient at that time, but unfortunately not for 5.x anymore. So thanks again for that one |
Registered Member
|
This helped me big time today as the / directory on one of my machines with windows 8, 2 versions of Linux Mint KDE, and KDE Neon had me at 98%. Thank you.
Migrated from Linux Mint 17.3/18.3 KDE to KDE neon User Edition.
|
Registered Member
|
Thanks for both finding then posting the code. |
Registered Member
|
Big thanks! My install got tremendously big with time because of this stupid issue and I was running out of apps to remove and had to constantly use bleachbit up until to the point it didn't cut it anymore today and I couldn't log into using xsession One little retarded thing to bring the whole system down given time, sigh... I've signed into launchpad issue https://bugs.launchpad.net/ubuntu/+bug/1907887 to give it a "affects me too" vote, hopefully it will get fixed faster that way...
Free open source game, master your beasts! - https:/AncientBeast.com
|
Registered Member
|
Thanks! This script found some old nvidia garbage lurking and even loading as well as cleaned up my kernels. |
Registered Member
|
This worked like a charm! I was able to remove like 10 unused kernels. Thanks for sharing! |
Registered Member
|
Has this bug been fixed? I just cleaned out old kernels in KDE Neon and in Debian Testing too. Maybe they fixed the bug, but it didn't affect kernels older than the bug fix.
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]