Gentoo Wiki



Linux provides a method for allowing programs that need to compile against the kernel (such as kernel modules, nvidia-drivers for example) to know which version they should compile against. This is the /usr/src/linux symlink.

Gentoo additionally provides an easy tool for moving this symlink around, called kernel-config (It's actually part of eselect, so make sure that package is installed). To see a quick summary of how to use kernel-config, run it with no other options: kernel-config

Listing Available Sources

Now that the new kernel sources are installed, move the symlink to point to them using the following procedure. First list the available kernel sources with: kernel-config list

Code: Example output of kernel-config
Available kernel symlink targets:
  [1]   linux-2.6.17-gentoo-r7
  [2]   linux-
  [3]   linux-
  [4]   linux-
  [5]   linux-2.6.18-gentoo-r3
  [6]   linux-2.6.18-gentoo-r4
  [7]   linux-2.6.18-gentoo-r6 *
  [8]   linux-2.6.18-usermode
  [9]   linux-2.6.18-usermode_guest
  [10]  linux-2.6.18-usermode-r1
  [11]  linux-
  [12]  linux-
  [13]  linux-2.6.19-gentoo-r3
  [14]  linux-2.6.19-gentoo-r3-guest
  [15]  linux-2.6.19-gentoo-r3-skas-v9-pre9
  [16]  linux-2.6.19-gentoo-r4
  [17]  linux-2.6.20-rc5

the currently selected sources are marked with an ' * ' (for older versions run : readlink /usr/src/linux)

Changing the Target

Now set the symlink to the new kernel sources. For example, if the new sources are vanilla-sources 2.6.20-rc5, then run: kernel-config set 17

Alternatively, the sources directory name can also be used, for example: kernel-config set linux-2.6.20-rc5

Retrieved from ""

Last modified: Wed, 06 Aug 2008 21:04:00 +0000 Hits: 1,537