Pages

How to update Linux kernel in Debian

Debian is a Linux-based operating system. The Linux kernel is the core component of any Linux-based operating system, acting as a bridge between the hardware and the software. It manages critical tasks such as memory allocation, process scheduling, device drivers, and file system interactions. Linux kernel development is an active process. The Linux kernel may be old if you use the stable version of Debian. Updating your Linux kernel is crucial for security, performance, and hardware compatibility. For example, the Debian 12 stable version consists of Linux kernel version 6.1. Debian repository contains the latest Linux kernel version and can be installed in the system. The following are the procedures for updating the kernel from the stable version of Debian to the new one.

Check the current kernel version

Apply the following command in the terminal to see the kernel version.

uname -r

Add the backport repository to the system

The latest kernel versions are available in the backport repository of Debian Linux. Debian Backports is a repository that provides newer versions of software packages for the current stable release of Debian. This means that users can access more up-to-date software without having to upgrade their entire system to the testing or unstable branches of Debian, which may be less stable. Apply the following command to create a new file to start the backport repository.

sudo mousepad /etc/apt/sources.list.d/debian-backports.list

Following is the backport repository address of Debian 12. Copy the line into the file, Save and close it. If the Debian version is other than 12, replace the release name (e.g. bookworm, trixie).

deb http://deb.debian.org/debian bookworm-backports main

Save and close the file. Apply the following command to update the repository information.

sudo apt update && sudo apt upgrade

Search for and list the latest kernel versions 

We can easily find it and install it using the Synaptic package manager. If Synaptic is not installed, install it first.

sudo apt install synaptic

Open Synaptic from the terminal,

sudo synaptic

Synaptic will open and search for the term, linux-image, in the search box. Find the latest version of linux-image available. 

Select it, Right-click, mark it for installation and install it.

After the installation, verify whether the latest Linux-kernel installed or not. Apply the following command,

dpkg --list | grep linux-image


Note down the linux-image version.

Change the Default Kernel on Debian

Apply the following command with the kernel version. This is the syntax of the command,

sudo grub-set-default <linux-image-version>

Replace the <linux-image-version> with the installed kernel version.
Here is an example,

sudo grub-set-default linux-image-6.10.6+bpo-amd64

Restart the computer and check the default kernel version.

uname -r


No comments:

Post a Comment