HowTo: Ubuntu Linux Install Kernel Source Code And Headers

http‮/:s‬/www.lautturi.com
HowTo: Ubuntu Linux Install Kernel Source Code And Headers

To install the kernel source code and headers on an Ubuntu Linux system, you can use the following steps:

  1. Install the required packages:
sudo apt-get update
sudo apt-get install linux-headers-$(uname -r) build-essential

This will install the kernel headers package and the build-essential package, which includes the tools required to build and install kernel modules.

  1. Install the kernel source code:
sudo apt-get install linux-source

This will install the kernel source code in the /usr/src/ directory.

  1. Extract the kernel source code:
tar -xjf /usr/src/linux-source-4.4.0.tar.bz2 -C /usr/src/

Replace 4.4.0 with the version of the kernel source code you want to extract. This will extract the kernel source code into a directory with the same name as the tarball, without the .tar.bz2 extension.

  1. Set up the kernel source code tree:
cd /usr/src/linux-source-4.4.0
make mrproper

This will set up the kernel source code tree, preparing it for building and installing kernel modules.

Created Time:2017-10-29 22:08:45  Author:lautturi