

Once installed you will find the source file 2 in /usr/src folder.
Compile linux kernel install#
For example, if you want the 3.16 kernel you would write “apt-get install linux-source-3.16” without the quotes.
Compile linux kernel download#
You can download the kernel source package with apt-get or Synaptic.

(module-assistant seems to be of less and less use, being replaced by DKMS packages) In a terminal:Īpt-get install build-essential fakeroot kernel-package libncurses5-dev libqt4-dev module-assistant You can apt-get install all the programs above the way they are written, or get them through Synaptic. Module-assistant – this program is needed to build the missing modules after kernel compilation Linux-source- – this is the kernel source package you need to download in order to build the kernel. Libqt4-dev – these files are needed for running make xconfig with QT 4. Libncurses5-dev – this program is needed for using make menuconfig or make xconfig.
Compile linux kernel code#
Kernel-package – this program is needed for creating kernel deb packages.īuild-essential – this program is needed for compiling source code into machine binaries (programs).įakeroot – this program removes the need to become root for building a package Since it’s not advisable to compile the kernel as root, you should extract the kernel source to a folder in your /home as a normal user, and then all the commands (except the installation commands) should be run as normal user. Comment or remove any lines starting with GRUB_HIDDEN, and if the word splash appears in the line GRUB_CMDLINE_LINUX_DEFAULT, remove it.NOTE: the standard method of upgrading a kernel is spelled out in the Users Manual. The make deb-pkg command will create five deb packages in /usr/src/ that you will need to install: dpkg -i linux-*.debĮdit /etc/default/grub and add or change the following variables to match. Compile the KernelĬompile and install the kernel and modules: make deb-pkg Once your configuration options are set, exit the configuration interface and answer “y” for yes when asked whether you would like to save the new kernel configuration. For example, to enable SELinux support, check the option “Security options –> NSA SELinux Support” in the configuration interface: make menuconfig Enable any additional options, making sure to leave filesystem support (likely ext3 or ext4) compiled into the kernel ( not configured as a module). Make oldconfig prompts the user to answer any new configuration options not present in the old configuration file.Ĭhanges to the kernel’s configuration can be made with the menuconfig command. All Linode kernels expose their configuration via /proc/config.gz. We recommend that you start with a kernel configuration (config) from a running Linode kernel. Some required configuration options may include: CONFIG_KVM_GUEST=y The kernel must be properly configured to run within the Linode environment. A conventional location to download to is /usr/src/: cd /usr/srcĮxpand the archived file and change directories: tar -xvf linux-4.7.tar.xz Warning, this will delete everything within the /boot/ directory without asking for confirmation: rm -rf /boot/*Ĭompile and Install the Kernel Download Kernel Sourcesĭownload the latest 4.x kernel sources from. Since some distributions install a pre-compiled kernel package into the /boot/ directory along with their development package, avoid confusion later by removing any existing files there.

Unless you’re planning on using the Direct Disk option in the Linode Configuration Manager, this is not required. When installing GRUB, you’ll be asked which disk images you’d like GRUB to configure.
