Step 1: Install Required Packages
Install additional packages before building a kernel. To do so, run this command:
sudo apt-get install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc flex libelf-dev bison
Step 2:
Download the Kernel source code from kernel.org, Extract the tar file
Install linux-headers for the base kernel version use following command to know the base kernel version 'uname -a'
Step3 :
Goto the Extracted directory/folder
run following command
make menuconfig
then save the configurationg and click exit
Step 4 :
Run the following command for compiling kernel
make
Step 5 :
Install kernel modules and kernel
make modules_install
make install
Step 6:
If amd based CPU in the machine
sudo apt-get install firmware-amd-graphics