Installing the Linux kernel 5.x on Debian 10

Kernel is central component of an operating system that manages operations of computer and hardware. It basically manages operations of memory and CPU time. It is core component of an operating system. Kernel acts as a bridge between applications and data processing performed at hardware level using inter-process communication and system calls.

Step 1 - Find Current Kernel Version

Debian 10 comes with Kernel 4.19 as default version. This can be upgraded to 5.x version available right now using the backport repository.

Let us confirm the current kernel version we're on using the uname command.

uname -r

Output:

root@vps:~# uname -r
4.19.0-20-amd64

Step 2 - Update the Sources

Upgrading the kernel to 5.x requires you to add the backports repository into the sources.list file. Backports are the packages from the next version of Debian that is going to be or has been released.

Let us add the backports repository into sources.list and update the packages,

echo "deb http://deb.debian.org/debian buster-backports main" | tee -a /etc/apt/sources.list

apt-get update

Output:

root@vps:~# echo "deb http://deb.debian.org/debian buster-backports main" | tee -a /etc/apt/sources.list
deb http://deb.debian.org/debian buster-backports main

root@vps:~# apt-get update
Hit:1 http://security.debian.org/debian-security buster/updates InRelease
Hit:2 http://deb.debian.org/debian buster InRelease
Get:3 http://deb.debian.org/debian buster-updates InRelease [56.6 kB]
Get:4 http://deb.debian.org/debian buster-backports InRelease [51.4 kB]
Get:5 http://deb.debian.org/debian buster-backports/main amd64 Packages [487 kB]
Get:6 http://deb.debian.org/debian buster-backports/main Translation-en [411 kB]
Fetched 1,007 kB in 1s (1,242 kB/s)
Reading package lists... Done

Step 3 - Install the Kernel

Once the packages have been updated, let us verify the kernel versions which are available for us to install.

For this, run the following command,

apt search linux-image

You can notice several versions being listed that are available from backports repository.

To install the new kernel, run the following command,

apt -t buster-backports upgrade

Once the Kernel has been installed, reboot the server so it can boot into the new version.

reboot

Step 4 - Verify the Kernel Version

Now, let us confirm the kernel version the Debian system is on by using the uname command.

uname -r

Output:

root@vps:~# uname -r
5.10.0-0.deb10.16-amd64