- Thread: How to update/downgrade kernel in ubuntu
- How to update/downgrade kernel in ubuntu
- Re: How to update/downgrade kernel in ubuntu
- Downgrade linux kernel ubuntu
- How to roll back the kernel version on Ubuntu
- How to Install the Latest Mainline Linux Kernel Version in Ubuntu [GUI and Terminal Methods]
- Using the latest Linux kernel version in Ubuntu: Things you should know
- Why install a new Linux kernel version manually?
- HWE kernel option is also available
- Older kernels remain available
- Two ways of installing new kernel in Ubuntu: Command line and GUI
- Method 1: Manually install new Linux kernel in Ubuntu using command line
- Step 1: Check current installed version
- Step 2: Download the mainline Linux kernel of your choice
- Step 4: Install the downloaded kernel
- Step 5: Reboot Ubuntu and enjoy the new Linux kernel.
- Rollback the changes and downgrade Linux kernel
- Method 2: Upgrade Linux Kernel in Ubuntu Ukuu GUI tool
- Step 1: Install Ukuu in Ubuntu
- Step 2: Install kernel with Ukuu
- Rollback the changes/Downgrade Linux Kernel with Ukuu
Thread: How to update/downgrade kernel in ubuntu
Thread Tools
Display
How to update/downgrade kernel in ubuntu
i’m trying to understand how to manage Kernel Upgrade or Downgrade(if necessary) in Ubuntu.
I’ve searched in various forum but i’m still a bit confused sometimes
What i have undestood is:
apt-get upgrade —> upgrade only packeges already installed but not Kernel
apt-get distr-upgrade —> do also Kernel upgrade
I tried in an old VM installed ubuntu 14.04 running apt-get dist-upgrade
and i have upgraded the kernel from 3.16.0.30 to 3.16.0.77
After i have rebooted the system and i tried to run again apt-get distr-upgrade
but no upgrade were available. This means that apt-get distr-upgrade i cannot upgrade
over the 3.16.0.77 version??
In my «experiment» i have updated the kernel till 4.2.0.38 version. this is what i did:
After running apt-cache search linux-generic i had a list of kernel i choose to install 4.2.0.38 running apt-get install linux-image-4.2.0.38-generic
I saw a lot of other kernel available, till 4.4.0.98 version if i remember well, but running apt-get dist-upgrade no upgrade are available.
From what i have understood if i want to upgrade kernel i need to do it «manually», running apt-install linux-image-x.x.x.x-generic choosing the version i want. Correct or not?
With apt-get dist-upgrade which kind of kernel upgrade are available?
With google i also find that is possible to update the kernel with dpkg but which packages i have to download?
Last Question, if updating Kernel Something goes wrong how to downgrade to the old version?
Re: How to update/downgrade kernel in ubuntu
i’m trying to understand how to manage Kernel Upgrade or Downgrade(if necessary) in Ubuntu.
I’ve searched in various forum but i’m still a bit confused sometimes
What i have undestood is:
apt-get upgrade —> upgrade only packeges already installed but not Kernel
Not completely correct if the kernel is receiving security/feature updates then it will be updated as well.
«dist-upgrade» pulls in all held packages and fully updates your system. (In a nut shell)
Now if you go outside of your default kernel>>>you may be at risk of security flaws. Just a heads-up!
**Warning** playing with kernels can either make or break your system . (Needs experienced user or know how to get yourself out of trouble if need to)
Pretty much any Linux distribution you can upgrade and downgrade kernels at will. Typically just a matter of installing the correct packages. Make sure you INSTALL, not upgrade with the new package (otherwise it may overwrite the existing one).
That’s the beauty of «kernel» versus «distribution».
There may also be a kernel firmware package that you should install alongside the new kernel package.(This is where the experience comes in to play)
Источник
Downgrade linux kernel ubuntu
The cause is installed with the Ubuntu 20.04 version, its kernel is 5.8, compiled by this version of the kernel Compile Positive Atom’s 4.15 version of the core, the kernel is prompting the file system error, whether it is NXP original or positive atom’s error. But downloading the 5.10 version of the kernel compile will pass smoothly. I don’t know why, since I don’t want to replace Ubuntu 16.04, I can only select the kernel downgrade.
This installation is the Linux-4.15.0-39 version core, other versions of everyone selection download
First, add a source image to prevent «E: Unable to locate the package problem»
1, switch to root mode
2, backup mirror sources
3, edit the mirror source
4. Increase the mirror source, this time it is added to Tsinghua’s mirror source, you can also add other sources.
Add the following to the last line of Sources.List
5, update the mirror
Second, download the Linux kernel (mode 1)
1, query the kernel list
2, install the version 4.15.0-39 version image
3, install the number of cores 4.15.0-39
4, install the 4.15.0-39 version kernel module
5, install the driver of version 4.15.0-39
6, query the currently currently installed kernel
You can see if the kernel is successfully installed from above.
Three installation Linux kernel (mode 2)
1. Download the Linux kernel installation package from the kernel official website or elsewhere
2, use the CD command to enter the installation package directory
3, install the kernel
4. Query the currently installed kernel
If an error is reported, the reason for the error is found, and the re-execution is resolved.
Fourth, switch the kernel version (important)
As we all know, bootloader is the first program that is running when the computer is started. Responsible for loading and transmitting control information to the operating system kernel, and the kernel is responsible for initializing the rest of the operating system. GNU Grub is a very powerful bootloader that loads many free operating systems and operating systems using chain-loading.
GRUB has two different guidance methods, one is to directly load the operating system, and another is chain loading. It is usually used in the first way because it does not need to be installed or maintained, and the GRUB can load the operating system from any disk / partition in this manner. However, the latter mode is sometimes necessary because GRUB does not support direct loading of all operating systems. Chain load only supports PC BIOS and EFI platforms.
GRUB is configured by ‘grub.cfg’ files, usually located under the / Boot / GRUB path. This file is quite flexible, but it usually does not need to be fully written by the user.
1, check the kernel position you need to use
After opening, as shown below, the second line is clearly written «Do not edit the file.»
After we look down until you see Menuentry ‘Ubuntu’, menuntry indicates the display entry for the GRUB startup option. As follows.
The ride is the menu structure displayed by the grub boot boot interface, which can be summarized as follows:
Therefore, the kernel version we have to switch is the 5th under the Ubuntu advanced option. Since the default is calculated from 0, the order of Linux 4.15.0-39-generic is 1> 4.
The grub.cfg file is then closed.
2, change the GRUB default startup item
This command needs to operate in root mode
3. Switch the kernel
After opening the GRUB file, find GRUB_DEFAULT=0 This item is defined to modify it to GRUB_DEFAULT=“1 > 4”
Where ‘1> 4’ represents the fourth kernel file in the Ubuntu advanced option (due to the calculation from 0, it is actually the fifth file).
4, update boot boot file
5, restart kernel
6. After boot, check the kernel level, verify that it is successful
Источник
How to roll back the kernel version on Ubuntu
Sometimes after updating the kernel of the system, some important services start to work incorrectly and in order not to look for a problem on the combat server, and to do it for example later on the virtual one, you can boot the system from the previous version of the kernel.
First, we will look at the current version (I have displayed 4.15.0-46-generic):
For the test, I took Ubuntu Server 18.04, the system was on a virtual stand and had not been updated for a long time, I specifically performed the update:
Restart the system so that it boots from the new version of the kernel and then again we will see the version (I already have a newer version – 4.15.0-47-generic):
Logs of installing updates if you can see anything in /var/log/dpkg.log and /var/log/apt/.
If you have direct access to the server, you can select “Advanced options for Ubuntu” in the grub menu when you start the system and then select the correct kernel, but after restarting the system, the newest will still start.
To start the system from a previous kernel version, open the grub configuration file in a text editor:
And instead of “GRUB_DEFAULT = 0”, we specify (in the nano editor, to exit, press Ctrl+X and “y” to save the changes):
Since the numbering of the menu grub comes with 0, 0 is the usual system load, in the first menu “Advanced options for Ubuntu” will be number 1, and in the second menu where you need to select the kernel “4.15-46-generic” will be number 2. You can see the menu in the file /boot/grub/menu.lst.
Installed kernels are located in the /boot/ directory, you can also see the command:
Update grub to apply changes:
Restart the system and check the kernel version again (in my case the system booted from the old 4.15.0-46-generic kernel):
You can also find and install a different version of the kernel (see if there is enough memory in the /boot/ directory if it is located on a separate partition):
This kernel will most likely be number 4 in the menu, so we’ll point it out in the /etc/default/grub file and then restart the system:
You can also leave “GRUB_DEFAULT = 0” and delete the new kernel, after which the previous one will become the main one, but it’s better not to do so:
Источник
How to Install the Latest Mainline Linux Kernel Version in Ubuntu [GUI and Terminal Methods]
Last updated October 29, 2020 By Abhishek Prakash 54 Comments
This article shows you how to upgrade to the latest Linux kernel in Ubuntu. There are two methods discussed. One is manually installing new kernel and the other uses a GUI tool providing even easier way.
I am assuming that you already know what is Linux kernel. This is the core software that drives any Linux distribution. This is what Linus Torvalds created around 30 years ago and this is what he still works on.
A newer version of Linux kernel is released every few months with new features (such as support for more hardware), bug fixes etc.
But most Linux distribution does not provide the latest Linux kernel unless you are using an Arch-based distribution or some other rolling release distribution.
Linux distributions are responsible for your system’s stability and this is why they don’t release a newer version of Linux Kernel to its users unless they test it for regression on their end. They often use a specific kernel release as base and provide you updates on this base kernel, instead of giving you the latest mainline kernel.
This does not mean that you cannot use the latest Linux kernel in Ubuntu or other distribution you are using.
In this tutorial, I’ll discuss various ways to get a new Linux kernel on Ubuntu.
Using the latest Linux kernel version in Ubuntu: Things you should know
In my opinion, there is no ‘real’ need of upgrading to a newer Linux kernel unless it provides you a good enough reason.
Why install a new Linux kernel version manually?
What could be such a reason? Well, suppose the new Linux kernel introduces support for your sound card or Wi-Fi card or some other hardware component. You read some official forum that the problem you are having with the hardware component could be fixed with a newer Linux kernel version.
HWE kernel option is also available
You should also keep in mind that Ubuntu has this hardware stack enablement (HWE) feature that lets you use somewhat newer Linux kernel on an Ubuntu LTS release.
Older kernels remain available
Another thing to note here is that installing a new kernel doesn’t mean that the older kernel has been removed from the system. It remains at your disposal. By default, Ubuntu boots into the newest Linux Kernel installed on the system.
Two ways of installing new kernel in Ubuntu: Command line and GUI
There are two ways to install newer Linux kernel:
The GUI tool Ukuu is not open source anymore and it locks a few feature which I have discussed in its section.
Let’s see the methods.
Method 1: Manually install new Linux kernel in Ubuntu using command line
The latest Linux kernel is called mainline Linux kernel. You’ll see this term used often.
I must warn you that you should be aware of the risk. If something goes wrong, you may revert to a previous Kernel version but you must not panic. Make a backup of Ubuntu system to be sure. If you are easily baffled with troubleshooting, avoid playing with manual upgrades and stick to your distribution’s system updates.
Step 1: Check current installed version
You may want to first check current installed version of kernel. You can do this by using the uname command in the terminal:
As you can see in output below, I have kernel version 5.4 installed.
Step 2: Download the mainline Linux kernel of your choice
Now you have to download the desired kernel build provided Ubuntu from here.
You can see kernel list like this. I am going to download kernel 5.7. You also should keep in mind to install the stable kernel instead of rc (release candidate).
Now download appropriate kernel files for your architecture. For 64 bit architecture, you should download these kind of files
- linux-headers-VERSION-NUMBER_all.deb
- linux-headers-VERSION-NUMBER_amd64.deb
- linux-image-VERSION-NUMBER_amd64.deb
- linux-modules-VERSION-NUMBER_amd64.deb
Hence I will download these files:
Step 4: Install the downloaded kernel
Now it’s time to install downloaded kernel. First do into the directory where you’ve downloaded kernel and enter following command. Make sure there isn’t any other “.deb” file in that directory other than downloaded kernel files.
sudo dpkg -i *.deb
It will take some time. After installation finished, you will see screen like this.
Step 5: Reboot Ubuntu and enjoy the new Linux kernel.
Now you’ve installed new kernel in Ubuntu successfully, it’s time to reboot the machine. Ubuntu by default boots into the newer kernel version.
After rebooting, check kernel version with same uname -sr command you used earlier. As you can see, it’s updated to 5.7.0.
Rollback the changes and downgrade Linux kernel
If you didn’t like new Linux Kernel or if you discovered issues with it. You can easily downgrade the Kernel. You just have to:
- Boot into an older kernel
- Remove the newer Linux kernel you don’t want
Let’s see how to do that.
When you are booting into your system, on the grub menu, select the Advanced options for Ubuntu.
If you do not see the grub menu, try holding the shift key or use Esc key to bring the grub menu.
In here, you’ll see all the Linux kernels installed on your system. Select an older one. Don’t choose the recovery mode, just go with the normal ones.
Now that you have booted into your good old kernel, we have to remove new kernel.
You can use the apt or dpkg command to remove the installed kernel version. Do you remember the version of new kernel you installed manually? For me it was kernel 5.7. So here’s what I use to delete it.
Change the commands with the version you want to install:
You can see, I have two packages associating with kernel 5.7.0. If I remove the first package it will automatically remove all it’s related dependencies.
Install New Linux Kernel 10
Method 2: Upgrade Linux Kernel in Ubuntu Ukuu GUI tool
You can upgrade Linux kernel on your own in Linux command line. But the kernel upgrade procedure is much easier and more convenient with a GUI tool called Ukuu (Ubuntu Kernel Update Utility).
This GUI tool is developed by Tony George who has provided us with several other useful tools for Ubuntu such as battery monitor for Ubuntu, app backup tool Aptik etc.
You should know that Ukuu of version above 18.9 is now paid and closed source. Version 18.9 is still free and open source.
Paid version contains additional features like:
- Downloading and installing newer kernel versions automatically
- Deleting downloaded packages after install
- Option to stay on same series of a kernel release
- Automatically removing older kernels.
- UI improvements.
If you want the additional features, you can purchase it from developer’s official website. Ukuu free version can still be used for installing and removing kernels, though.
Step 1: Install Ukuu in Ubuntu
You can download the deb files for the old Ukuu version 18.9 which is free to use but not updated lately.
Step 2: Install kernel with Ukuu
Once you have installed Ukuu, start it. It will refresh the list of available Linux kernels available for Ubuntu.
By default, it will show you all the available kernels, including the unstable release kernel (tagged with RC and with red Tux icon).
Kernel versions from the distributions are labeled with the logo and the other versions have just the good old Tux logo.
As you can see I have kernel 5.7.0 installed already, now I will install kernel 5.7.1 using Ukuu.
Again, you should avoid the release candidates. Select the desired Kernel version and click on install to install the newer Linux kernel version.
Of course, it will require admin password for this action. Once you have entered your password, you can see the installation progress in the application itself. Focus on the end result to know if it new Linux kernel was installed successfully or not.
Note: If the installation fails, no need to panic. Nothing will be wrong the system. Just try a different Kernel version and it might work.
You should see something like this when installation finished successfully.
Once installation finishes, you’ll see a very helpful screen that tells you if anything goes wrong with the new Linux kernel, you can always choose to boot into the older kernel from the grub menu.
When you boot into the system next, you’ll be running the Linux kernel you had just installed.
Rollback the changes/Downgrade Linux Kernel with Ukuu
Rollbacking done in two steps:
- Boot into an older kernel
- Remove the newer Linux kernel you don’t want
Let’s see how to do that.
When you are booting into your system, on the grub menu, select the Advanced options for Ubuntu.
Select your old kernel to boot into it.
Once you boot into the system with the older Linux kernel, start Ukuu again. Make sure that you are not deleting the kernel that you are running at present.
Select the newer kernel version which you don’t want anymore and click on Remove.
That’s all you need to do here to downgrade the Linux kernel in Ubuntu.
While we are discussing it, I would like to point out a few more features of Ukuu. Ukuu has settings option that allows you to not display release candidates of kernels in the list. You can also hide Linux kernel versions older than version 4.0.
You can also choose the option to display desktop notifications in case new Linux Kernel are available.
You can also remove Ukuu using apt remove ukuu command.
How do you upgrade Linux kernel?
I hope this tutorial was helpful to show you how to install mainline Linux kernel in Ubuntu.
So, do you often upgrade Linux kernel on your own or do you wait for your distribution to provide the upgrade? How do you do it?
Like what you read? Please share it with others.
Источник