How to Install Linux Kernel 6.0 on Debian 11/10

For most users, the standard Linux Kernel that ships with your distribution suites your purpose fine. But for users that would like to install the latest kernels that the Debian team is working on, which is usually found in the sid repository or better known as unstable can be more beneficial to install given it should be better compatible than a generic kernel in some circumstances along with being easy to upgrade.

The tutorial will demonstrate how to add the sid repository and create an apt pin using the command line terminal for users who prefer installing an upgraded kernel from the Debian team.

Recommended Steps Before Installation

Before proceeding with the tutorial, ensuring your system is up-to-date with all existing packages is good.

sudo apt update

Optionally, you can list the updates for users who require review or are curious.

sudo apt --list upgradable

Proceed to upgrade any outdated packages using the following command.



sudo apt upgrade

Import Sid / Unstable Repository

The following steps will explain how to import the sid/unstable repository. This is the repository.

First, copy and paste the following command.

echo "deb http://deb.debian.org/debian unstable main contrib non-free" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://deb.debian.org/debian unstable main contrib non-free" | sudo tee -a /etc/apt/sources.list

Create APT Pinning File

Next, an easy solution is to use apt-pinning to avoid having different version branches causing your system to prompt for updates from the experimental repository. Open the following file using a text editor.

sudo tee /etc/apt/preferences<<EOF
Package: *
Pin: release a=bullseye
Pin-Priority: 500

Package: linux-image-amd64
Pin:release a=unstable
Pin-Priority: 1000

Package: *
Pin: release a=unstable
Pin-Priority: 100
EOF

Please remember to replace the amd64 with the architecture of your system.

Optionally, you can open the preferences file to confirm that it has been added successfully using a text editor such as nano.

sudo nano /etc/apt/preferences

Example:



How to Install Linux Kernel 6.0 on Debian 11 Bullseye

The order goes, all packages are preferred to Bullseye with a higher score (500) than unstable (100), so you are not prompted on various packages to be updated from the unstable repository.

However, to make it easy to keep the kernel up to date when you run the apt update command for your standard Bullseye packages, the example above has set linux-image-amd64 as a high priority (1000) using the unstable repository above any other source for that package only.

Install Linux Kernel 6.0

The first thing to do is update your repository to reflect the changes to your sources list and preferences.

sudo apt update

You will notice you have a package to update.

1 package can be upgraded. Run 'apt list --upgradable' to see it.

For users newer to Linux, you can list what is upgradeable using the following command.

apt list --upgradable -a

Example output:



joshua@debian-11-bullseye:~$ apt list --upgradable -a
Listing... Done
linux-image-amd64/unstable 6.0.6-2 amd64 [upgradable from: 5.10.149-2]
linux-image-amd64/stable-security,now 5.10.149-2 amd64 [installed,upgradable to: 6.0.6-2]
linux-image-amd64/stable 5.10.84-1 amd64

The -a flag added to the command lists all versions available since alternatives may exist.

Run the apt upgrade command to begin updating to Linux Kernel 6.0, as this is what you have set in the preferences.

sudo apt upgrade

Once completed, reboot your system for the new kernel to activate.

reboot

Once logged back in, open your terminal and type the following command to verify the installation.

uname -r

Example output:

6.0.0-2-amd64

Alternatively, print your system specs with neofetch.



sudo apt install neofetch -y

Now run neofetch to get your Linux kernel version.

neofetch

Example Neofetch output:

How to Install Linux Kernel 6.0 on Debian 11 Bullseye

Any new updates will automatically be seen when you run the apt update command to check for updates for the rest of your Debian 11 Bullseye repository packages.

How to Restore the Default Kernel

For users who find the new kernel has bugs for their hardware, say, loss of sound, use the following steps to restore the default kernel; if you installed an alternative kernel, replace the default kernel section with whatever you want to install.

First, remove the kernel using the following command.

sudo apt autoremove linux-image-6.0*

Next, you will see the following prompt advising that you must make sure a kernel is installed or re-installed before you reboot if you remove the current kernel. Otherwise, your system will be destroyed, unbootable, broken, etc.



Example:

How to Install Linux Kernel 6.0 on Debian 11 Bullseye

Press the tab key, select <No>, and press the ENTER KEY.

For users with the preferences file configured for this package, you can remove the experimental repository or take out the kernel priority package referencing the unstable repository.

Remove the preferences file as an example.

sudo rm /etc/apt/preferences

Import the alternative with the kernel package now removed.

sudo tee /etc/apt/preferences<<EOF
Package: *
Pin: release a=bullseye
Pin-Priority: 500

Package: *
Pin: release a=unstable
Pin-Priority: 100
EOF

The alternative is using a text editor and removing the lines manually, which works just as well. This should be done if you have other packages customized.



Now run an APT update.

sudo apt update

Before we reboot, make sure the default generic is installed, do not fuss too much as you can install alternative versions later on as we are just trying to get your system back to working order with the default kernel for Debian.

sudo apt install --reinstall linux-image-generic

Now reboot.

reboot

Now verify the kernel installed, which should be the default generic kernel.

uname -r

Example output:

5.10.0-19-amd64

As mentioned above, you have fallen back to the default kernel.



Install Linux Kernel Alternative Methods

For those who want options besides the unstable repository, check out the following custom kernel tutorials, which often boast the latest Linux custom-built kernels.


Not what you were looking for? Try searching for additional tutorials.

1 thought on “How to Install Linux Kernel 6.0 on Debian 11/10”

  1. I think many of the new kernels are also in the bullseye-backports repository, which is probably a safer way to get the new kernel.

    Reply

Leave a Comment