This article is about compiling a kernel on Ubuntu systems. It describes how to build a custom kernel using the latest unmodified kernel sources from www.kernel.org (vanilla kernel) so that you are independent from the kernels supplied by your distribution.
Install the Required packages for building it
apt-get install git-core kernel-package fakeroot build-essential ncurses-devThen download latest kernel version
cd /usr/src
sudo su wget --continue http://www.kernel.org/pub/linux/kernel/v4.x/linux-4.xx.x.tar.bz2 tar jxvf linux-*.*.*.tar.bz2 cd linux-*.*.* $ cp /boot/config-`uname -r` ./.config $ make menuconfig
make-kpkg clean
fakeroot make-kpkg --initrd --append-to-version=-vanillaice kernel_image kernel_headers cd .. dpkg -i linux-image-*.*.*
dpkg -i linux-headers-*.*.*sudo shutdown -r now
you can install the headers too from /usr/src/linux-headers-3.*.*-*
in my case i can show you how the packages are named
ls *.deb linux-image-*.*.*-vanillaice_4.4.*-vanillaice-10.00.Custom_amd64.deb linux-headers-*.*.*-vanillaice_4.4.*-vanillaice-10.00.Custom_amd64.deb
I also created a python script http://github.com/mariuz/kernelcompile
that can be used like this
git clone https://mariuz@github.com/mariuz/kernelcompile.git
cd kernelcompile sudo ./kernel-compile.py