The kernel is the most important central core of an operating system. Most Linux distributions such as Ubuntu, Debian or CentOS 8 install a stable kernel version, but not the latest ones. And the kernel is not updated to a new major release unless you update the entire operating system. The Linux distributions maintain security patches for their kernel version, which makes the operating system more secure. Some users use Linux for their personal computer systems on which they use up-to-date hardware. For this purpose, it is more practical to use a newer kernel that can easily detect the latest devices. This way, the user can also improve the performance of devices that are already installed on the user’s system. So, this manual will show you how to upgrade the kernel in the CentOS 8 environment.
Upgrade the Kernel on CentOS 8
To upgrade the system’s kernel you need to perform the following steps:
- Open the terminal to click on Activities option that will be shown on the desktop left corner.
- In the next step, you need to log in as the root user to upgrade the kernel and install necessary repositories on your system. Run ‘su’ command on the terminal. Now you have been logged in as a root user.
Note: Before starting to upgrade the kernel, it is noted that if you are working well on your system then you do not need to upgrade the kernel. If you are using CentOS on the home or production server, it is also not recommended to upgrade the kernel unless to try it for testing.
You need to add the GPG key for the repository to make the installation secure. Type the following command on the terminal:
$rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
Now, you will add an external repository named ‘elrepo’ on your system. For this purpose, you need to install the following rpm package on CentOS 8.0:
$dnf install https://www.elrepo.org/elrepo-release-8.0-2.el8.elrepo.noarch.rpm
During the installation process, a user confirmation prompt will interrupt the installation task that will ask the user that either you want to complete the installation process or not. You will press the ‘y’ key from the keyboard to further proceed.
An external repository ‘elrepo’ has been successfully added to your system.
You can check the list of repositories and packages on the terminal. To display the list of packages with the complete status you need to run the following command:
Now, you will install the new kernel on your CentOS 8.0. But, before starting the installation, you will check the already installed version. To check the installed version run the following command on the terminal:
In the above-mentioned output, you can see the installed kernel version of CentOS 8.0.
It’s time to install a new kernel on your CentOS 8.0. To install new kernel, run the following command on the terminal:
$dnf --enablerepo=elrepo-kernel install kernel-ml
In the above-mentioned output image, you can see the latest available kernel version and dependencies will install on your system. During the installation process, again a user confirmation prompt will be displayed on the terminal. It will ask from the user that either you want to proceed with kernel installation or not. You will enter the ‘y’ key from the keyboard.
After completing the installation, you will reboot your system to view the changes. When you have started your CentOS 8.0, you will see an upgraded kernel that has been installed on your system.
Once you restart your system, then you will again open the terminal on your CentOS 8.0. Now, you will check the installed version by running the following command on the terminal:
$ uname -msr
In the output, you can see the upgraded installed version on your terminal window.
An upgraded kernel with the newest hardware can improve the performance of your system. In this article, you have learned how you can upgrade the CentOS 8.0 kernel. You have learned different commands related to adding repositories and view kernel version. I hope now you are able to upgrade the system’s kernel. It is recommended that if you do not have any problem with your system then you do not need to upgrade the system’s kernel.