Centos 7 upgrade to the latest kernel version

Centos 7 in a minimal installation environment

  1. Check installed kernel version
    uname -sr

  2. 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

  3. Once the repository is enabled, you can list the available kernel-related packages with the following command:
    yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
    kernel

  4. Next, install the latest mainline stable kernel
    yum --enablerepo=elrepo-kernel install kernel-ml

  5. 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 and GRUB_DEFAULT=saved
    add a line GRUB_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

  6. Finally, reboot the machine and apply the latest kernel, then run the following command to check the latest kernel version
    uname -sr
    write picture description here

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326054680&siteId=291194637