Reply to topic

Autoremove old kernels / kde Neon 5.20

User avatar minson
Registered Member
Posts
15
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
183
Karma
0
OS
Code: Select all
apt autoremove --purge -y
User avatar minson
Registered Member
Posts
15
Karma
0
does nothing

[email protected]:~$ 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

[email protected]:~$ 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.

[email protected]:~$ 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
183
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
User avatar dbergstein
Registered Member
Posts
34
Karma
0
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
75
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. Now 5.20.

 
Reply to topic

Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], gfielding, Google [Bot], ipwizard, irfanhilmi, jmacleod, robertrathbone