Abstract
To upgrade to a kernel I would suggest going for a stable build. Also, as a rule of thumb, I recommend always upgrading your kernel and never downgrading because it can cause system flaws.
Required Installs for this Guide
sudo apt-get install -y gcc libncurses5-dev make wget flex bison vim libssl-dev libelf-dev
How To
In order to change your current kernel it takes some patience and caution, but there is definitely a way to do it while still having the ability to revert back to the original kernel. So let's get started, I recommend doing all of this with root so first do sudo -i
and enter your password.
So let's go ahead and download the latest stable kernel as of now (2020-05-05).
wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.5.19.tar.xz
Note: You may need to install wget for this to work (apt-get install wget
).
Now let's extract this archive and move it to a suitable directory.
tar -xvf linux-5.5.19.tar.xz -C ../usr/src/
Note: You may need to install tar for this to work (apt-get install tar
).
This extracted the archive to a directory that contains all the other kernels. We're now going to cd
into that directory to complete the next few steps.
cd ../usr/src/linux-5.5.19/
Now for the fun part :)
If you don't have a strong computer this part can easily take 2 hours to complete so please be warned if you are on battery life or on a time crunch. Also, be sure to read all the following directions before rebooting (it will be essential if anything goes wrong).
We are now going to compile the kernel, so just follow the following commands and please let all of them run to completion. This first command usually takes the longest for people. Also, I will be using the -j4 flag on these make commands in order to speed up the process. It basically utilizes 4 cores for the compilation instead of one (I'm assuming you have 4 cores, and if not you can just leave off the -j4).
make -j4
Note: You may need to install make for this to work (apt-get install make
).
make modules -j4
make modules_install -j4
make install -j4
DON'T REBOOT YET
We will now be modifying grub to give you time to choose the kernel you want to use on startup.
cd ~/../etc/default/
vim grub
Note: You can use any text editor you're familiar with, another popular one is nano, but please be familiar with your choice and know how to edit and save. I have chosen vim for this guide and you may need to install vim for it to work (apt-get install vim
).
Modify the following lines to this (in vim you press i to start editing and navigate with the arrow keys):
GRUB_DEFAULT=2
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=25
To save the file, press ESC, then press :wq! and hit enter.
Now for your last and final step, you need to update grub.
update-grub2
Once that command finishes you may restart your system (reboot
).
Once the system comes back you will notice that you are prompted at startup for some options. Select advanced options and then select your new linux-5.5.19 kernel.
If there are any issues with this guide please leave a comment and I will try to address the issue by editing this guide.
Hope it works!
synaptic
. That's the easiest way IMHO. – Pilot6 May 05 '20 at 17:33