This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Autoremove old kernels / kde Neon 5.20

Tags: None
(comma "," separated)
User avatar
minson
Registered Member
Posts
30
Karma
0
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

?
User avatar
boospy007
Registered Member
Posts
237
Karma
0
OS
Code: Select all
apt autoremove --purge -y
User avatar
minson
Registered Member
Posts
30
Karma
0
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
User avatar
boospy007
Registered Member
Posts
237
Karma
0
OS
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
dbergstein
Registered Member
Posts
43
Karma
2
OS
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:

Code: Select all
sudo apt-mark auto $(apt-mark showmanual | grep -E "^linux-([[:alpha:]]+-)+[[:digit:].]+-[^-]+(|-.+)$")
User avatar
awi
Registered Member
Posts
2
Karma
0
OS
@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 :)
User avatar
blue_bullet
Registered Member
Posts
87
Karma
0
OS
dbergstein wrote: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:

Code: Select all
sudo apt-mark auto $(apt-mark showmanual | grep -E "^linux-([[:alpha:]]+-)+[[:digit:].]+-[^-]+(|-.+)$")

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.
scrawfuela
Registered Member
Posts
19
Karma
0
dbergstein wrote: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:

Code: Select all
sudo apt-mark auto $(apt-mark showmanual | grep -E "^linux-([[:alpha:]]+-)+[[:digit:].]+-[^-]+(|-.+)$")


Thanks for both finding then posting the code.
User avatar
Dread Knight
Registered Member
Posts
24
Karma
0
OS
dbergstein wrote: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:

Code: Select all
sudo apt-mark auto $(apt-mark showmanual | grep -E "^linux-([[:alpha:]]+-)+[[:digit:].]+-[^-]+(|-.+)$")



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 xD 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
etoven
Registered Member
Posts
2
Karma
0
dbergstein wrote: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:

Code: Select all
sudo apt-mark auto $(apt-mark showmanual | grep -E "^linux-([[:alpha:]]+-)+[[:digit:].]+-[^-]+(|-.+)$")


Thanks! This script found some old nvidia garbage lurking and even loading as well as cleaned up my kernels.
moltke
Registered Member
Posts
29
Karma
0
dbergstein wrote: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:

Code: Select all
sudo apt-mark auto $(apt-mark showmanual | grep -E "^linux-([[:alpha:]]+-)+[[:digit:].]+-[^-]+(|-.+)$")


This worked like a charm! I was able to remove like 10 unused kernels. Thanks for sharing! :)
kde-mikedee
Registered Member
Posts
9
Karma
0
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.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]