[HowTo] Update your kernel to the latest

Here is where you can post tips and tricks to share with other users of MX. Do not ask for help in this Forum.
Message
Author
vandykmarsu
Posts: 12
Joined: Wed Mar 04, 2020 8:55 pm

[HowTo] Update your kernel to the latest

#1 Post by vandykmarsu »

How to upgrade the kernel to the latest via backports sources.


addition of necessary sources:

#stable

Code: Select all

echo "deb http://ftp.fr.debian.org/debian/ buster-backports main" >> /etc/apt/sources.list
echo "deb-src http://ftp.fr.debian.org/debian/ buster-backports main" >> /etc/apt/sources.list
#non-free

Code: Select all

echo "deb http://ftp.fr.debian.org/debian/ buster-backports main contrib non-free" >> /etc/apt/sources.list
echo "deb-src http://ftp.fr.debian.org/debian/ buster-backports main contrib non-free" >> /etc/apt/sources.list

Code: Select all

apt update

To know how kernel are installed:

Code: Select all

uname -a

Good news LMDE4 already has backports repository activated by default, we use later the backports sources to update our kernel.


To search a newest kernel:

Code: Select all

apt search linux-image

In the output we will see a lot of kernels, but we have interest to the latest, at this time the kernel 5.7:

Image


Lets do it and install the latest kernel:

Code: Select all

apt install linux-image-5.7.0-0.bpo.2-amd64 linux-headers-5.7.0-0.bpo.2-amd64 -t buster-backports -y

A reboot is needed to boot on the new kernel:

Code: Select all

reboot

We can check now:

Code: Select all

uname -a

The output:

Code: Select all

Linux my-pc 5.7.0-0.bpo.2-amd64 #1 SMP Debian 5.7.10-1~bpo10+1 (2020-07-30) x86_64 GNU/Linux

let's take it a step further by removing the old kernels, in general it is advisable to keep 2 kernels in case there is a problem with one of them.

To view the installed kernel:

Code: Select all

dpkg --list 'linux-image*'
In the output you will see how kernel you can purge, in my case i keep the 4.19 and the 5.7 and purge the 5.6.


Example to purge a kernel:

Code: Select all

apt autoremove --purge linux-image-5.6.0-0.bpo.2-amd64 linux-headers-5.6.0-0.bpo.2-amd64 -y

We need to upgrade the grub with the changes we made:

Code: Select all

update-grub2

After an reboot in the boot menu, select advanced options, you can also check the kernels who are usable.
Last edited by vandykmarsu on Sat Aug 15, 2020 7:34 am, edited 1 time in total.
Ryzen 3600 - AB350Gaming - 16Gb - RX570 8Gb - PSU Lepa 500W - Case Z9 Neo

SwampRabbit
Posts: 3602
Joined: Tue Jun 14, 2016 2:02 pm

Re: [HowTo] Update your kernel to the latest

#2 Post by SwampRabbit »

Thank you for making a HowTo.

But, why not use the MX Package Installer and Debian Backports tab?
For a new and novice user we already have a much simpler way.

You don't have to mess with your sources.list and you don't have to use the Debian mirror in France, not everyone lives in France.
I lived in Grenoble France in the early 2000s, I enjoyed my time there, but still not everyone needs to use the Debian mirror in France. ;)

If you want to make HowTos, it would be great if you did them using all the amazing tools that make it easy for new and novice users, which is the preferred MX way.
NEW USERS START HERE FAQS, MX Manual, and How to Break Your System - Don't use Ubuntu PPAs! Always post your Quick System Info (QSI) when asking for help.

User avatar
sunrat
Posts: 663
Joined: Mon Mar 28, 2016 9:54 pm

Re: [HowTo] Update your kernel to the latest

#3 Post by sunrat »

Apart from doing it the hard way instead of the easy MX way as SwampRabbit posted,
vandykmarsu wrote: Fri Aug 14, 2020 8:59 am addition of necessary sources:

#stable

Code: Select all

echo "deb http://ftp.fr.debian.org/debian/ buster-backports main" >> /etc/apt/sources.list
echo "deb-src http://ftp.fr.debian.org/debian/ buster-backports main" >> /etc/apt/sources.list
#non-free

Code: Select all

echo "deb http://ftp.fr.debian.org/debian/ buster-backports main contrib non-free" >> /etc/apt/sources.list
echo "deb-src http://ftp.fr.debian.org/debian/ buster-backports main contrib non-free" >> /etc/apt/sources.list
You only need one of those 4 lines and you don't need the deb-src lines to install a new kernel.
We need to upgrade the grub with the changes we made:

Code: Select all

update-grub2
No you don't, apt will do that automatically.

User avatar
asqwerth
Developer
Posts: 7770
Joined: Sun May 27, 2007 5:37 am

Re: [HowTo] Update your kernel to the latest

#4 Post by asqwerth »

re: update-grub2, the only 2 distros I've seen in the past few years still using "grub2" are Fedora and PCLinuxOS, both rpm-based distros.

When I installed PCLOS in 2015 on my machine, it was still on legacy grub when most other distros were already using grub2. For PCLOS, 'grub' was legacy grub with the menu.lst grub menu. So its /boot/grub folder held all the legacy grub stuff. WHen I subsequently installed their grub2, it installed all the grub2 stuff in the /boot/grub2 folder.

But Debian and Ubuntu had long moved to grub=grub2 by then, and grub.cfg was just stored in /boot/grub folder. And AFAIK, the update command has simply been "update-grub" for a long time. (probably a shortcut or alias, but still.... it's been that for yonks)
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400

Huckleberry Finn

Re: [HowTo] Update your kernel to the latest

#5 Post by Huckleberry Finn »

SwampRabbit wrote: Fri Aug 14, 2020 9:56 am Thank you for making a HowTo.

But, why not use the MX Package Installer and ...
Literally agree.

User avatar
sunrat
Posts: 663
Joined: Mon Mar 28, 2016 9:54 pm

Re: [HowTo] Update your kernel to the latest

#6 Post by sunrat »

asqwerth wrote: Fri Aug 14, 2020 11:51 amAnd AFAIK, the update command has simply been "update-grub" for a long time. (probably a shortcut or alias, but still.... it's been that for yonks)
It's still in Debian as a symlink, didn't check MX right now.

Code: Select all

$ file /usr/sbin/update-grub2
/usr/sbin/update-grub2: symbolic link to update-grub

User avatar
andyprough
MX Packager
Posts: 918
Joined: Tue Jul 23, 2019 10:16 pm

Re: [HowTo] Update your kernel to the latest

#7 Post by andyprough »

asqwerth wrote: Fri Aug 14, 2020 11:51 am re: update-grub2, the only 2 distros I've seen in the past few years still using "grub2" are Fedora and PCLinuxOS, both rpm-based distros.

When I installed PCLOS in 2015 on my machine, it was still on legacy grub when most other distros were already using grub2. For PCLOS, 'grub' was legacy grub with the menu.lst grub menu. So its /boot/grub folder held all the legacy grub stuff. WHen I subsequently installed their grub2, it installed all the grub2 stuff in the /boot/grub2 folder.

But Debian and Ubuntu had long moved to grub=grub2 by then, and grub.cfg was just stored in /boot/grub folder. And AFAIK, the update command has simply been "update-grub" for a long time. (probably a shortcut or alias, but still.... it's been that for yonks)
'update-grub2' is a valid command on Debian-based distros, as it is a "stub for running grub-mkconfig -o /boot/grub/grub.cfg to generate a grub2 config file" according to the update-grub manpage. Both 'update-grub2' and 'update-grub' do the same thing, they invoke the same stub.
Primary Computer - Commodore 64: Processor - MOS 6510/8500, 1.023MHz; Memory - 64kb RAM, 20kB ROM - 8k BASIC V2, 8k Kernel, 4k Character ROM; Display output - 320x200, 16 colours; OS - BASIC V2.0; Weight: 1.8kg

User avatar
Stevo
Developer
Posts: 14441
Joined: Fri Dec 15, 2006 7:07 pm

Re: [HowTo] Update your kernel to the latest

#8 Post by Stevo »

In my experience, it doesn't matter what command you use to update GRUB, because you don't need to issue one at all--adding, upgrading, or removing a kernel updates the menu automatically. So it's a non-issue.

It's also missing the warning that third party drivers like Nvidia, virtualbox-dkms, or broadcom-sta may not build with a new kernel, though we try to stay ahead of that in the AHS repo, at least. These instructions get a D- grade at best.
Last edited by Stevo on Sat Aug 15, 2020 1:22 am, edited 1 time in total.

User avatar
asqwerth
Developer
Posts: 7770
Joined: Sun May 27, 2007 5:37 am

Re: [HowTo] Update your kernel to the latest

#9 Post by asqwerth »

Per my post above, I did guess that update-grub and update-grub2 do the same thing due to shortcuts or aliases (so now I know that in fact update-grub2 is a symlink to update-grub) , but the point was that it hasn't been necessary to include the '2' in Debian in ages.

I still use :

Code: Select all

grub2-mkconfig -o /boot/grub2/grub.cfg
In my fedora install to update grub.

ADDED: and Stevo is right that these instructions aren't the most appropriate and there are caveats/cautions attached.
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400

Post Reply

Return to “Tips & Tricks by users”