LinuxCommandLibrary

eclean-kernel

old kernel removal utility

TLDR

List all kernel files

$ sudo eclean-kernel -l
copy
Keep only two newest kernels
$ sudo eclean-kernel -n 2
copy
Remove kernels with confirmation
$ sudo eclean-kernel -a -n 2
copy

SYNOPSIS

eclean-kernel [options]

DESCRIPTION

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.

PARAMETERS

-l, --list-kernels

List all installed kernels
-n, --num n
Number of kernels to keep
-a, --all
Ask before each removal
-p, --pretend
Show what would be removed
--no-mount
Don't mount /boot if unmounted

CAVEATS

Gentoo-specific. Always keep at least one working kernel. The currently running kernel is protected.

SEE ALSO

eclean(1), emerge(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community