Download and configure linux kernel

install compilation tools on a ubuntu distro 18.04 (linux mint,xubuntu)

sudo apt-get update && sudo apt-get upgrade
sudo apt-get install fakeroot build-essential ncurses-dev xz-utils libssl-dev bc bison flex
 sudo apt-get install kernel-package

now download linux kernel in this tutorial 4.18.16 it might not be the latest

wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.18.16.tar.xz

untar the kernel

tar -xvf linux-4.18.16.tar.xz

go to the directory and copy the current config from your current kernel look carefully at what to enable in make oldconfig

 cp -v /boot/config-$(uname -r) .config
 make oldconfig

Warning do not do this if you’re not familiar with Linux. If you want to customize your kernel more you can run make menuconfig or install kernel patches (example ssd patch)

Compile the kernel you can compile using fakeroot

fakeroot make-kpkg --initrd  kernel_image kernel_headers -j 16

installing the kernel

cd ..
sudo apt install ./linux*.4.18.16*.deb

now reboot your system

  sudo reboot

sources

  1. https://www.cyberciti.biz/faq/debian-ubuntu-building-installing-a-custom-linux-kernel/