Build new Linux Kernel via the CLI.

20 Dec

While trying to solve a persistant message in the console cifs vfs free previous_auth.response I came across a post which suggests a kernel update would resolve the issue.

Install requirements to build the kernel:
[bash]apt-get install build-essential libncurses5-dev bison flex libelf-dev ca-certificates bc libssl-dev[/bash]

Download the kernel, extract, and import current configuration:
[bash]cd /tmp
wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.19.11.tar.xz
tar xvf linux-4.19.11.tar.xz
cd linux-4.19.11
cp -v /boot/config-$(uname -r) .config[/bash]

Run this command, then exit, when prompted (saves a lot of questions during build process):
[bash]make menuconfig[/bash]

Build and create deb packages:
[bash]make deb-pkg -j 4[/bash]

Once complete; deb packages can be found in the directory immediately above:

  • linux-headers-4.19.11_4.19.11-1_amd64.deb
  • linux-image-4.19.11_4.19.11-1_amd64.deb
  • linux-image-4.19.11-dbg_4.19.11-1_amd64.deb
  • linux-libc-dev_4.19.11-1_amd64.deb

It should be noted the only file which needs to be installed is: linux-image-4.19.11_4.19.11-1_amd64.deb.

To install, simply run:
[bash]dpkg -i /tmp/linux-image-4.19.11_4.19.11-1_amd64.deb[/bash]

Once you reboot, you can validate the new kernel is running via:
[bash]uname -r[/bash]