Centos 7 in a minimal installation environment
Check installed kernel version
uname -sr
Using the third-party repository of ELRepo under CentOS, you can upgrade the kernel to the latest version.
ELRepo repository official website:
http://elrepo.org/tiki/
After importing the public key, install the rpm of ELRepo just fine
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
The official website of ELRepo said that you can use the plugin of fastestmirror to let yum judge according to the ping value when updating, and then download it from the address with the fastest response.
sudo yum -y install install yum-plugin-fastestmirror
Once the repository is enabled, you can list the available kernel-related packages with the following command:
yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
Next, install the latest mainline stable kernel
yum --enablerepo=elrepo-kernel install kernel-ml
To make the newly installed kernel the default boot option, you need to modify the GRUB configuration as follows:
Open and edit /etc/default/grub
to comment out the original andGRUB_DEFAULT=saved
add a lineGRUB_DEFAULT=0
that means the first kernel on the GRUB initialization page will be the default kernel.Next run the following command to recreate the kernel configuration.
grub2-mkconfig -o /boot/grub2/grub.cfg
Finally, reboot the machine and apply the latest kernel, then run the following command to check the latest kernel version
uname -sr