← 返回命令列表

Linux command

eclean-kernel 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

List

sudo eclean-kernel -l

Example

sudo eclean-kernel -n 2

Preview

sudo eclean-kernel -p -n 2

Example

sudo eclean-kernel -A -n 2

Example

sudo eclean-kernel -a

说明

eclean-kernel removes old kernels in Gentoo Linux. It cleans up kernel images, modules, and related files while preserving a specified number of recent kernels. Over time, /boot and /lib/modules accumulate old kernel versions from upgrades, consuming significant disk space. This is particularly problematic on systems with small boot partitions. eclean-kernel automatically identifies and removes old kernel files while protecting the running kernel and a configurable number of recent versions. The tool handles all kernel-related components including the kernel image, System.map, initramfs, config files, and module directories. It's safer than manual deletion as it understands kernel dependencies and prevents removing essential files.

参数

-l, --list-kernels
List all installed kernels and exit
-n _NUM_
Keep N newest kernels
-A, --ask
Ask before removing each kernel
-a, --all
Remove all kernels unless referenced by bootloader
-d, --destructive
Destructive mode: remove kernels even when referenced by bootloader
-p, --pretend
Print kernels to be removed and exit
-b, --bootloader _BOOTLOADER_
Bootloader used (auto, lilo, grub2, grub, yaboot, symlinks)
-x, --exclude _KERNEL_
Exclude a specific kernel from removal
--no-bootloader-update
Do not update bootloader configuration after removal

FAQ

What is the eclean-kernel command used for?

eclean-kernel removes old kernels in Gentoo Linux. It cleans up kernel images, modules, and related files while preserving a specified number of recent kernels. Over time, /boot and /lib/modules accumulate old kernel versions from upgrades, consuming significant disk space. This is particularly problematic on systems with small boot partitions. eclean-kernel automatically identifies and removes old kernel files while protecting the running kernel and a configurable number of recent versions. The tool handles all kernel-related components including the kernel image, System.map, initramfs, config files, and module directories. It's safer than manual deletion as it understands kernel dependencies and prevents removing essential files.

How do I run a basic eclean-kernel example?

Run `sudo eclean-kernel -l` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -l, --list-kernels do in eclean-kernel?

List all installed kernels and exit