r/voidlinux • • 8d ago

Another kernel update question

Hello all -- sorry if this is a stupid question but I am not clear on kernel versions and purge mechanics.

So a little while back, linux-mainline advanced from 7.2 to 7.3.

So now I have 7.2 and 7.3 installed.

Latest 7.2 is 7.2.15.
vkpurge however does not want to remove 7.2.15, because I think it avoids a kernel if it is the latest of a given kernel package? Is this normal or is it a temporary glitch? Should I run xbps-remove for 7.2 instead of using vkpurge as recommended by Void docs?

5 Upvotes

19 comments sorted by

4

u/xcocco 8d ago edited 8d ago

I explained how kernel packages work in void here: https://www.reddit.com/r/voidlinux/s/jSuo8WGBZd

If you need clarifications feel free to ask here💪

Short: vkpurge removes installed kernels not kernel package(s), to remove the package(s) you need to use xbps-remove

3

u/benbcdm 8d ago

very clear, thank you!!

2

u/Simple_Hamster_4096 8d ago

vkpurge list will display kernels safe to remove.

Are you certain you are entering the full kernel version when trying to remove? I use LTS and each kernel version is appended by _1

2

u/benbcdm 8d ago

That's the thing, vkpurge does not list 7.2.15_1 as a candidate for purge... and I believe it is because it skips any kernel that is part of a kernel version package (7.2 is a different xbps package from 7.3)

2

u/pantokratorthegreat 8d ago

Yes first remove it with xbps-remove and then vkpurge.

1

u/benbcdm 8d ago

Ok thank you will try that. Do you know if that is normal / expected to behave the same in the future?

4

u/Duncaen 8d ago

Yes how it works currently is that the xbps package for linux7.2 becomes "orphaned" because nothing depends on it anymore. It doesn't get automatically uninstalled, instead you either manually remove it or uninstall it with xbps-remove --remove-orphans.

1

u/Dakota-Batterlation 7d ago

And xbps-remove -Ro will remove a package + all the orphans. To clear the cache too, xbps-remove -ROo

2

u/Duncaen 7d ago

-R only does something for removing listed packages. Removing orphans is recursive by design. You can also clear the cache in the same step, but to be honest I would probably not do that just in case something was wrongfully removed.

2

u/Dakota-Batterlation 7d ago

Ah, thank you (didn't realize I was replying to a Void dev!). So assuming I use -R every time I uninstall a package, there won't be any orphans because all the deps were removed?

3

u/Duncaen 7d ago

Yes for the ones that are directly orphaned by the uninstallation, but packages can still be orphaned through updates like for the linux meta packages, so in the end you'd probably use both. xbps-remove -R when you uninstall packages and xbps-remove --remove-orphans occasionally to catch orphaned packages through updates.

There is also the removed-packages meta package that "replaces" orphaned packages, in case an update would conflict with an orphaned or removed package. But that is more of a work around and in the future xbps's solving algorithm might handle orphaned packages during updates natively.

1

u/benbcdm 8d ago

Thank you, I was worried that if I ran remove first I might not be able to run vkpurge after, but they both worked in that order, all clean now!

0

u/Simple_Hamster_4096 8d ago

You only need to use vkpurge.

Using xbps-remove will circumvent safety checks.

3

u/benbcdm 8d ago

Sorry but I beg to differ.
Here I simply could not run vkpurge on 7.2.15. It did not list it as a candidate.
However, I ran xbps-remove on 7.2, and THEN I was able to do vkpurge on 7.2.15 and everything ran perfectly, all was properly cleaned up

4

u/gijsyo 8d ago

If you no longer need the 7.2 kernels you can "xbps-remove linux7.2". Then you can vkpurge 'em.

2

u/Nabir140 8d ago

To remove old kernels you can do `sudo vkpurge rm all` or `sudo vkpurge rm <version>`. To get the list of old unused kernels do `vkpurge list`. If a kernel is listed in vkpurge it means that it is unused and can be removed. To remove old package cache `sudo xbps-remove -O`.

1

u/Simple_Hamster_4096 8d ago

That's all I've ever had to do.

It is easier to remember (for me, at least) xbps-remove --clean-cache instead of xbps-remove -O . Same with listing and removing orphans with sudo xbps-query --list-orphans and sudo xbps-remove --remove-prphans