voidlinux remove old kernels & modules

I noticed while updating my void that kernels were being updated, but old ones weren't being removed. Removing orphan packages didn't remove those old files either. I looked for those packages, but they weren't even listed in either the local or the remote repository. It seems kernel packages seem to be a one-way install, and the old package disappears when a new update appears. No wonder I couldn't remove them.

A quick visit to #voidlinux, and I found the solution: vkpurge

# vkpurge -h
Usage: vkpurge  []

Targets:
 list                   Lists old installed kernels.
 rm     Remove kernel  or all old kernels.

Example:
        $ vkpurge list
        $ vkpurge rm 2.6.39.2

# vkpurge list
4.12.13_1
4.13.10_1
4.13.7_1
4.9.11_1

# vkpurge rm 4.12.13_1
Removing kernel 4.12.13_1 files ...
Removing /boot/config-4.12.13_1...
Removing /boot/System.map-4.12.13_1...
Removing /boot/vmlinuz-4.12.13_1...
Removing /lib/modules/4.12.13_1...
Running post-remove kernel hook: 20-dracut...

No disasters.. So I do them all in one go. I have two kernel meta-packages installed - linux and linux-lts, neither listed in vkpurge.

# vkpurge rm all

Safely remove all but explicitly installed kernels.

ref: http://voidlinux.eu/faq/#removing-old-kernels

1 comment:

most viewed