In order to start loving Debian - we need to try out other Linux distributions and see how easily things may break after system upgrade. While Debian is super stable - it could have a problem with newer hardware - older kernel versions might not simply support it.
There is relatively stable way of installing newer kernel while still maintaining Debian golden stability. This approach is called backports
. Here can be found official Debian article: Installing a Package from Backports
In short - we can add repository from testing release and install those package we need from it. It won’t use it by default even if we add to the system but would update those packages we’ve already installed from backports. We are still installing LTS version, not the latest kernel which still should be stable.
Let’s do it the right way:
1. Make a backup
Simply install timeshift
and make a backup
2. Add backports repository to the system.
While website guides us to add only main
repo:
deb http://deb.debian.org/debian bookworm-backports main
We are going to need more in order to install newer kernel:
We are going to make a new file that would be located in /etc/apt//etc/apt/sources.list.d
File content would look like this:
deb http://deb.debian.org/debian <debian-codename>-backports main non-free contrib non-free-firmware
Replace <debian-codename>
with latest Your distribution code name. It could be checked with this command: lsb_release -c
Then we just need do:
sudo apt update
3. Install kernel
Get current kernel installed:
uname -r
If we get amd64
at the end, then we install newer kernel with following command.
Install newer kernel with command:
sudo apt install -t $(lsb_release -cs)-backports linux-image-amd64
We also would need to intall linux headers, for the purpose if some other applications to be compiled that interract with kernel directly. For instance Virtualbox will not work, if system have secure boot enabled
sudo apt install -t $(lsb_release -cs)-backports linux-headers-amd64
-t $(lsb_release -cs)-backports
is the key here as we explicitly use backports repository.
There might be errors signalling that some drives were not available and that’s ok.
4. Install latest firmware
It might work and be enough with just installing firmware and might be not. Some users reported intel-wifi stopped working with newer kernel.
Here we are going to install all the newer firmware available
See what firmware is already installed:
apt list --installed | grep firmware
as result we might get something like this (terminal output stripped):
firmware-amd-graphics
firmware-iwlwifi
firmware-linux-free
firmware-linux-nonfree
firmware-linux
firmware-misc-nonfree
firmware-realtek
Now we could update all the firmware already present in system to those from backports. It’s done in similar way as kernel itself. Here is example:
sudo apt install -t $(lsb_release -cs)-backports firmware-amd-graphics
After having installed all the firmware - time to reboot the system and boot into newer kernel.
If something goes wrong - system could be booted into the older kernel. Debian, as of day of writing keep 2 kernels installed.