Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install or upgrade the latest kernel in CentOS 7

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces how to install or upgrade the latest kernel in CentOS 7, the content is detailed and easy to understand, the operation is simple and fast, and it has a certain reference value. I believe you will gain something after reading this article on how to install or upgrade the latest kernel in CentOS 7. Let's take a look.

During normal operation, the kernel performs two important tasks:

Acts as an interface between the hardware and the software running on the system.

Manage system resources as efficiently as possible.

To do this, the kernel communicates with the hardware through built-in drivers or drivers that can later be installed as modules.

For example, when a program running on your computer wants to connect to a wireless network, it submits the request to the kernel, which in turn uses the correct driver to connect to the network.

As new devices and technologies come out on a regular basis, it's important to keep the kernel up-to-date if we want to make the most of them. In addition, updating the kernel will help us take advantage of new kernel functions and protect ourselves from vulnerabilities found in previous versions.

Are you ready to update the kernel on centos 7 or its derivatives such as rhel 7 and fedora? If so, please continue to read!

Step 1: check the installed kernel version

Let's install a distribution that contains a specific version of the kernel. To show the installed version of the current system, we can:

# uname-sr

If we go in now, at the time of this writing, we see that the latest kernel version is 4.10.1 (other versions are available from the same website).

Another important thing to consider is the lifecycle of the kernel version-if the version you are currently using is nearing the end of its life cycle, no more bug fixes will be provided after that date. For more information, see.

Step 2: upgrade the kernel in centos 7

Most modern distributions provide a way to upgrade the kernel using and officially supported repositories.

However, this will only upgrade the kernel to the latest version available in the repository-not the latest version available in. Unfortunately, red hat only allows kernel upgrades using the former.

Unlike red hat, centos allows the use of elrepo, a third-party repository that can upgrade the kernel to the latest version.

To enable the elrepo warehouse on centos 7, run:

# rpm-- import https://www.elrepo.org/rpm-gpg-key-elrepo.org# rpm-uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm

Enable elrepo on centos 7

After the repository is enabled, you can use the following command to list the available kernel-related packages:

# yum-- disablerepo= "*"-- enablerepo= "elrepo-kernel" list available

Next, install the latest mainline stable kernel:

# yum-enablerepo=elrepo-kernel install kernel-ml

Finally, restart the machine and apply the latest kernel, then run the following command to check the latest kernel version:

Uname-sr

Step 3: set the default kernel version of grub

To make the newly installed kernel the default startup option, you need to modify the grub configuration as follows:

Open and edit / etc/default/grub and set up grub_default=0. This means that the first kernel of the grub initialization page will be the default kernel.

Grub_timeout=5grub_default=0grub_disable_submenu=truegrub_terminal_output= "console" grub_cmdline_linux= "rd.lvm.lv=centos/root rd.lvm.lv=centos/swap crashkernel=auto rhgb quiet" grub_disable_recovery= "true"

Next, run the following command to recreate the kernel configuration.

# grub2-mkconfig-o / boot/grub2/grub.cfg

Restart and verify that the latest kernel is the default kernel.

This is the end of the article on "how to install or upgrade the latest kernel in CentOS 7". Thank you for reading! I believe that everyone has a certain understanding of "how to install or upgrade the latest kernel in CentOS 7". If you want to learn more, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report