How to use the command `vkpurge` (with examples)
- Linux
- December 25, 2023
The vkpurge
command is a useful tool for managing old kernel versions left behind by the xbps
package manager in Void Linux. It provides options to list and remove kernel versions based on specified criteria such as matching version numbers or removing all unused kernels.
Use case 1: List all removable kernel versions (or those matching version
if the argument is specified)
Code:
vkpurge list version
Motivation: This use case is helpful when you want to check which kernel versions can be removed from your system, either all of them or those matching a specific version number. It allows you to safely clean up your system and free up disk space.
Explanation:
vkpurge
is the command itself to invoke thevkpurge
tool.list
is the subcommand that specifies the action to be taken, in this case, listing kernel versions.version
is an optional argument that can be used to filter the list of kernel versions. It supports shell globs, so you can specify matching patterns.
Example output:
3.10.0_3-1
3.14.0_2-1
4.9.0_1-1
Use case 2: Remove all unused kernels
Code:
vkpurge rm all
Motivation: This use case is useful when you want to remove all unused kernel versions from your system at once. It helps you maintain a clean and more secure system by eliminating unnecessary files.
Explanation:
vkpurge
is the command to invoke thevkpurge
tool.rm
is the subcommand that specifies the action to be taken, in this case, removing kernel versions.all
is an argument used to specify that all unused kernel versions should be removed. This option deletes all kernel files except the currently running and the latest installed kernel versions.
Example output:
Removing kernel version: 3.10.0_3-1
Removing kernel version: 3.14.0_2-1
Removing kernel version: 4.9.0_1-1
Use case 3: Remove kernel versions matching version
Code:
vkpurge rm version
Motivation: This use case is handy if you want to selectively remove only specific kernel versions that match a particular version number. It allows you to remove outdated or problematic kernel versions while keeping others intact.
Explanation:
vkpurge
is the command to invoke thevkpurge
tool.rm
is the subcommand that specifies the action to be taken, in this case, removing kernel versions.version
is an argument used to specify the specific kernel versions you want to remove. It supports shell globs, so you can specify matching patterns.
Example output:
Removing kernel version: 3.14.0_2-1
Removing kernel version: 4.9.0_1-1
Conclusion:
The vkpurge
command provides a straightforward and convenient way to manage old kernel versions in Void Linux. It offers options to list removable kernel versions, remove all unused kernels, and remove kernel versions based on specified version numbers. By using vkpurge
, you can keep your system clean, organized, and more secure by removing unnecessary kernel files.