Kernel Updates

Jarret B

Well-Known Member
Staff member
Joined
May 22, 2017
Messages
340
Reaction score
367
Credits
11,754
Keeping your system up-to-date is a very important process done by most Linux users. Most applications are automatically updated or even manually. In most cases the item which is not normally updated is the kernel.
If you have read my other article on “Understanding the Linux Kernel” at https://www.linux.org/threads/understanding-the-linux-kernel.12508/ then you should have an understanding of the kernel.

Checking current kernel version

Before you update a kernel you should see what version you are currently using. It is not necessary, but you may want to know how much of an update is being performed.
To find the current version run the following command in a Terminal:

uname -r

The result may be something like:

4.8.6_300.fc25.x86_64

The whole kernel version is the first part ‘4.8.6_300’. The kernel is version 4 with a major version of 8 and a minor version of 6. The 300 is the patch number. The ‘x86_64’ represents a 64-bit processor using the Intel x86 instruction set.

Updating Red Hat Distros

To update a Red Hat system, specifically CentOS and Fedora, is a simple task.
Open a Terminal and type the following command:

sudo yum -y update kernel

The command will update the kernel and all required dependencies. To make the update take effect you need to reboot the system. Before you reboot you need to check one other thing.
If you use the GRUB Boot-loader then you will need to update the GRUB menu. If the menu is not updated, then you will most likely boot using the older kernel.

GRUB Menu Update

To check if you use GRUB you need to use a text editor. On a command line you can use the name of the text editor, such as gedit, and use the command:

gedit /etc/default/grub

NOTE: Change the name ‘gedit’ to the name of your editor. The file should be opened as ‘Read-Only’ unless you have raised privileges. You do not need to make any changes, only see if the file exists.

There is a line which will be useful if you are using an Ubuntu-based system. The line is ‘GRUB-TIMEOUT=’. The number after the setting is the number of seconds to show the menu before auto-selecting the default option.

If GRUB is installed then you need to update the menu system with the new kernel version. The command to update the GRUB menu if it is installed is:

sudo update-grub

After GRUB has been updated you need only to reboot the system and run ‘uname -r’ to verify the kernel change.

Updating Ubuntu Distros

Ubuntu Distros have a nice utility which can be used to perform updates as well as remove older kernel versions. As newer updates are released, the utility will list these updates and allow you the option to install them. There is also an option to see the changes made to a selected kernel version.

So, we need to get the Ubuntu Kernel Update Utility (UKUU). To install UKUU you need to open a Terminal and execute the following commands:

sudo apt-add-repository -y ppa:teejee2008/ppa
sudo apt-get update
sudo apt-get install ukuu

When you open the UKUU program, you should see a window similar to Figure 1.

Figure 01.jpg

FIGURE 1

Before you start performing kernel updates, there are some settings which need to be changed so your system is not updated to an unstable kernel (unless you want to test an unstable kernel).

Click on the ‘Settings’ button and you should see a Settings window as shown in Figure 2. Under the ‘Display’ section you may want to check-mark both options. Other options will be for your preference. Once you have made the necessary selections you can click on the ‘OK’ button. To make sure all settings are in effect, click on the ‘Refresh’ button.

Figure 02.jpg

FIGURE 2

To update to a new kernel, select the line listing the new kernel and then click on the ‘Install’ button. You should then be prompted for the Root password to perform the update.

A window will appear as shown in Figure 3. A process is run which downloads and updates the kernel to the specified version. UKUU will update the Initial RamDisk as well as the GRUB Menu if found.

Figure 03.jpg

FIGURE 3

At this point, you can reboot and check the current kernel version with the command:

uname -r

Before rebooting, you should see that the kernel has been installed as shown in Figure 4.

Figure 04.jpg

FIGURE 4


Removing a kernel

If a kernel is no longer needed or you may require more space on the Boot volume, you can purge a kernel.

Select the kernel to remove and click on ‘Remove’. You should be prompted for the Root password to continue the removal. The initial RamDisk for the specified kernel will be removed and the GRUB menu will be updated.

To remove multiple kernels from the system you can hold down the ‘SHIFT’ key and select multiple kernels with the mouse. Select ‘Remove’ to remove the multiple kernels.

NOTE: Do not try to remove the running kernel version which is shown at the bottom of the main UKUU window as you can see in Figure 1.

After a kernel install

After a kernel installation you will be shown a window similar to Figure 5.

Figure 05.jpg

FIGURE 5


As you can see, an update could cause problems as listed on the window. If an issue should arise, simple reboot and select the previous kernel version that worked. Once Linux is running you can open UKUU and remove the kernel which wouldn’t work properly.

Removing UKUU

To remove the UKUU program, if you do not want to use it, you can use the following command in a Terminal:

sudo apt-get purge ukuu
 

Members online


Latest posts

Top