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:

apt-get install build-essential libncurses5-dev bison flex libelf-dev ca-certificates bc libssl-dev

Download the kernel, extract, and import current configuration:

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

Run this command, then exit, when prompted (saves a lot of questions during build process):

make menuconfig

Build and create deb packages:

make deb-pkg -j 4

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:

dpkg -i /tmp/linux-image-4.19.11_4.19.11-1_amd64.deb

Once you reboot, you can validate the new kernel is running via:

uname -r

2 thoughts on “Build new Linux Kernel via the CLI.

Leave a Reply

Your email address will not be published.