LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

eselect-kernel

Kernel source symlink manager for Gentoo

TLDR

List available kernel source targets
$ eselect kernel list
copy
Set the /usr/src/linux symlink by number
$ eselect kernel set [number]
copy
Set the /usr/src/linux symlink by name
$ eselect kernel set [linux-6.1.0-gentoo]
copy
Show current kernel symlink target
$ eselect kernel show
copy

SYNOPSIS

eselect kernel action [options]

DESCRIPTION

eselect kernel is a module of the eselect framework that manages the /usr/src/linux symlink on Gentoo systems. This symlink is critical as it determines which kernel source tree is used when building external kernel modules, configuring the kernel, or compiling software that needs kernel headers.When multiple kernel source versions are installed (common during kernel upgrades or testing), this tool provides an easy way to switch between them without manually recreating the symlink. This is particularly important for maintaining external modules like graphics drivers or virtualization software that must be compiled against the correct kernel sources matching the running or target kernel version.

PARAMETERS

list

List available kernel sources with numbers, asterisk marks current selection
set target
Set /usr/src/linux symlink to target (name or number from list)
show
Display the current symlink target

CAVEATS

Gentoo Linux specific. Requires kernel sources to be installed via emerge. Changes affect kernel module compilation paths. Does not affect the currently running kernel, only which source tree is pointed to by /usr/src/linux.

SEE ALSO

eselect(1), emerge(1)

Copied to clipboard
Kai