How to update the kernel for linux centos7

Update centos7 kernel
First, install the yum source elrepo
upgrade the kernel needs to use elrepo source of yum, yum source before installing elrepo we also need to import the key, as follows:

rpm -import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
problems when importing can click directly on the Web page to download linux, and then
rpm -import absolute file path

-Uvh RPM http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
automatically installed after the download page can click installation problems arise when

Elrepo after the key is installed, the following we officially upgrade the kernel.

Second, upgrade the kernel
to install the latest mainline stable kernel, use the following command:

yum -y –enablerepo=elrepo-kernel install kernel-ml

clip_image006[4]

By the figure, we can clearly see that the latest kernel version 4.11.8.

After centos7 kernel upgrade is complete, do not take effect immediately, we also need to modify the default grub kernel version.

Third, modify the default kernel version grub
after centos7 kernel upgrade is complete, we also need to modify the kernel boot sequence, use the following command:

vim /etc/default/grub

GRUB_DEFAULT=0

clip_image008[4]

Next also need to run grub2-mkconfig command to re-create the kernel configuration, as follows:

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

clip_image010[4]

Fourth, restart the system and check the system kernel
grub configuration after the modification is completed, we need to restart the system, use the following command:

shutdown -r now

clip_image012[4]

After the system is up, we see the kernel version, as follows:

uname -r

clip_image014[4]

By the map, we can easily see, centos7 currently used by the kernel to version 4.11.8.

Centos7 about this kernel upgrade, have all been completed.

From the original https://www.ilanni.com/?p=13279

Guess you like

Origin blog.csdn.net/weixin_43232423/article/details/89635516