1 year ago
Due to dependency issues when I installed an application on the latest release of Ubuntu Server I had to do a kernel rollback. Therefore I will gladly share the steps that I took.
Before proceeding with these steps, please make sure that you know what you are doing since this can cause a lot of issues if done wrong.
My first step is to verify what kind of version my current kernel and Linux headers are.
You might wonder why I mention Linux headers, that’s because we have to use the same version of Linux headers as the kernel version to make all functions work correctly.
I will start by verify that I actually don’t already have the correct versions installed by running the below code.
# Verify Linux kernel & header version uname -a uname -r
In the next step I will install the Linux headers that I’m in need of. Remember to change the version in the below code to what you are in need of.
# Install & verify installed Linux Headers sudo apt-get update sudo apt-get upgrade linux-headers-5.4.0-73-generic apt list --installed linux-headers*
Now we will install the kernel version that we are looking for, make sure that you install the same version as the Linux headers you installed in the previous step.
# Will list your installed kernels & install your new. sudo dpkg -l | grep linux-image sudo apt-cache policy linux-image-5.4.0-73-generic sudo apt install linux-image-5.4.0-73-generic sudo dpkg -l | grep linux-image
This step is a bit tricky since we now need to point out which kernel we actually want to be used. If you install a kernel, that won’t automatically be set as your active kernel.
sudo nano /etc/default/grub # Find the row that says "GRUB_DEFAULT=" and edit the text to: GRUB_DEFAULT="1>2" # This is all based on how many kernels you have installed on the computer, you can count them by running the command "dpkg -l | grep linux-image" sudo update-grub sudo reboot sudo dpkg -l | grep linux-image
You should now have a new kernel version, this can be verified by running the following commands.
# Verify Linux kernel and header version uname -a uname -r
If you need any help with this, feel free to leave a comment below or contact me on LinkedIn! 🙂
Vi erbjuder personlig rådgivning med författaren för 1400 SEK per timme. Anmäl ditt intresse i här så återkommer vi så snart vi kan.