A Kernel? Link to heading

The kernel is the core of the Operating System, bridging the connection between the hardware & applications by providing the necessary drivers & utilities for the system to function. If you're running newer hardware or are just wanting to optimise your kernel then you'll need to know how to compile a kernel.

Over at kernel.org the latest stable, development & longterm kernels are maintained.

Due to the kernel being used by all Linux distributions there is a very low chance that the kernel running on any popular Linux operating system is the latest & greatest. This is due to the extensive tweaking & testing done by the distribution maintainers to deliver a stable user experience.

How To Link to heading

In the event that a new kernel is released with functionality required for your system then you can compile a new version of the kernel on your system as follows.

  • Download kernel source tarball (from kernel.org downloads) to /tmp/
  • Untar the source in the correct location
[root@asuka ~]# cd /usr/src/
[root@asuka ~]# tar xf /tmp/linux-kernel-**version**.tar.gz
  • Change to the source directory
[root@asuka ~]# cd linux-kernel-**version**
  • Configure the kernel
[root@asuka ~]# make oldconfig  <span style="color: #ff0000;">**_[Keeps old kernel configuration and only asks for answers to kernel additions]_**</span>
[root@asuka ~]# make menuconfig  <span style="color: #ff0000;">**_[Starts again with a menu configuration, can be used after make oldconfig to tweak/change settings]_**</span>
  • Create and install the kernel
[root@asuka ~]# make && make modules_install && make install
  • Check /boot/grub/grub.cfg for latest kernel bootload
  • Reboot the machine and check for new kernel
[root@asuka ~]# /sbin/init 6
_**Wait for machine to come back up**_
[root@asuka ~]# uname -r