Installing a newer kernel on LMDE 5

Write tutorials for LMDE here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post please read forum rules
Post Reply
User avatar
xenopeek
Level 25
Level 25
Posts: 29659
Joined: Wed Jul 06, 2011 3:58 am

Installing a newer kernel on LMDE 5

Post by xenopeek »

WARNING: Don't use these instructions if you use Nvidia proprietary drivers. It will break your system.

LMDE 5 uses kernel release 5.10. It will get security updates through Update Manager but no new releases. If you have very new hardware you may need to install a newer kernel release for all your hardware devices to work well.

For this you can use the Debian backports or Debian unstable repositories. At the time of this writing Debian backports has kernel version 5.16.12 (check current version here) and Debian unstable has version 5.16.18 (check current version here). Both of these repositories will get newer kernel releases over time.
Debian backports has software taken from the next Debian release, recompiled to work with the current Debian release. Debian unstable is where the development for Debian happens. Software from these repositories is not tested as extensively, may be incompatible with other software on your system and isn't directly managed by Debian's security team. You may not get security updates in a timely manner for kernels installed from these repositories.
Use these repositories at your own risk! Don't install a newer kernel release if you don't need to.

I'll gives instructions for both below. The instructions are for 64-bit installations. If you have a 32-bit installation replace all occurances of -amd64 with -686 in the instructions. If you're unsure what your installation is run the command uname -r to see whether you have the -amd64 or -686 kernel.

Using Debian backports
This should be the preferred method if you need a newer kernel release.

Debian backports is enabled by default on LMDE 5 but no software is installed from backports unless explicitly told to do so. To install the Debian backports kernel you can simply run this command:
apt install -t bullseye-backports linux-image-amd64 linux-headers-amd64

Once you've installed the kernel from backports you will also be getting kernel updates from there (or from other configured repository if it has a newer kernel version). You get the kernel updates as per usual through Update Manager.

Reboot your system to start using the new kernel. After reboot you can check which kernel version you're using with command uname -v.

Using Debian unstable (aka "sid")
Here be dragons. Be really sure that you need it before using Debian unstable!

Debian unstable is not enabled by default on LMDE 5. So in addition to configuring the system to install and update kernels from Debian unstable we'll also need to add the Debian unstable repository.

If you're the cautious sort make a system snapshot with Timeshift before proceeding!
  1. Run this command to open the text editor and create a new APT sources file:
    EDITOR='xed -w' sudoedit /etc/apt/sources.list.d/unstable.list
  2. Put the following in the file, this adds the Debian unstable repository:

    Code: Select all

    deb https://deb.debian.org/debian sid main contrib non-free
  3. Save the file and close the text editor.
  4. Run this command to open the text editor and create a new APT preferences file:
    EDITOR='xed -w' sudoedit /etc/apt/preferences.d/unstable.pref
  5. Put the following in the file, this enables installing and updating the kernel from Debian unstable but makes it so no other software is installed or updated from Debian unstable:

    Code: Select all

    Package: *
    Pin: release n=sid
    Pin-Priority: 1
    
    Package: linux-image-amd64 linux-headers-amd64
    Pin: release n=sid
    Pin-Priority: 100
  6. Save the file and close the text editor.
  7. Run apt update to refresh the package index cache and now you can install the kernel from unstable with command:
    apt install -t unstable linux-image-amd64 linux-headers-amd64
  8. Reboot your system to start using the new kernel.
After reboot you can check which kernel version you're using with command uname -v. If there is any problem with the new kernel you can boot the previous kernel from the boot menu's advanced options.
Image
jwiz
Level 4
Level 4
Posts: 349
Joined: Tue Dec 20, 2016 6:59 am

Re: Installing a newer kernel on LMDE 5

Post by jwiz »

Almost, but not quite.
If you have a system using nvidia graphics, you will also need to install the nvidia-driver package from bullseye-backports as otherwise the X server will crash with the newer kernel.
Furthermore you will have to install the respective linux-headers and the build-essential package to compile the driver module for the newer kernel.
User avatar
xenopeek
Level 25
Level 25
Posts: 29659
Joined: Wed Jul 06, 2011 3:58 am

Re: Installing a newer kernel on LMDE 5

Post by xenopeek »

jwiz wrote: Sun Apr 03, 2022 7:11 amIf you have a system using nvidia graphics, you will also need to install the nvidia-driver package from bullseye-backports as otherwise the X server will crash with the newer kernel.
You're right. I don't have a LMDE system with a Nvidia graphics card to test with. I've added a warning to not use these instructions with Nvidia proprietary drivers.
Image
User avatar
cpedretti
Level 3
Level 3
Posts: 199
Joined: Tue Mar 10, 2020 12:06 am

Re: Installing a newer kernel on LMDE 5

Post by cpedretti »

xenopeek wrote: Sun Apr 03, 2022 7:36 am
jwiz wrote: Sun Apr 03, 2022 7:11 amIf you have a system using nvidia graphics, you will also need to install the nvidia-driver package from bullseye-backports as otherwise the X server will crash with the newer kernel.
You're right. I don't have a LMDE system with a Nvidia graphics card to test with. I've added a warning to not use these instructions with Nvidia proprietary drivers.
To install the latest community NvidiaGraphicDriver on LMDE5 => HowTo :roll:
AMD Ryzen 7 3700X - 32GB DDR4 RGB White - RTX4060TI O8GB White- SSD NVME Crucial P5 500GB - Mobo Gigabyte AORUS ELITE B550 V2 - PSU Corsair RM750 White - Case Corsair 5000D Airflow White 7 fans AF120 ARGB - AIO Corsair H100I Cappelix 240 White
nextgenop
Level 1
Level 1
Posts: 13
Joined: Sun Apr 23, 2023 7:11 pm

Re: Installing a newer kernel on LMDE 5

Post by nextgenop »

I have added unstable repo and its pref. After sudo apt update, I got this
sudo apt install -t unstable linux-image-amd64 linux-headers-amd64
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
linux-headers-amd64 is already the newest version (5.10.179-2).
linux-image-amd64 is already the newest version (5.10.179-2).
The following packages were automatically installed and are no longer required:
libcamera0 libncursesw5 linux-headers-5.10.0-21-amd64 linux-headers-5.10.0-21-common linux-image-5.10.0-21-amd64
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 2192 not upgraded.
User avatar
Joss
Level 3
Level 3
Posts: 195
Joined: Wed Sep 23, 2015 7:38 am
Location: 19th Century Europe

Re: Installing a newer kernel on LMDE 5

Post by Joss »

If we install a newer Kernel will it be updated from then on, like from 5.16.12 to 5.16.18?
jwiz
Level 4
Level 4
Posts: 349
Joined: Tue Dec 20, 2016 6:59 am

Re: Installing a newer kernel on LMDE 5

Post by jwiz »

Most probably as the kernel 6.1 is the standard LTS kernel in Debian 12 and will be in the upcoming LMDE 6.
But otherwise the newer kernels form backport repos are just snapshots as the devs see fit and are not supporteded with regular updates.
Only the standard distro kernel is.
Hubbe
Level 1
Level 1
Posts: 3
Joined: Wed Aug 14, 2019 4:11 pm

Re: Installing a newer kernel on LMDE 5

Post by Hubbe »

Post Reply

Return to “Tutorials”