关于yum升级内核

导入key

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

安装elrepo 的yum源

rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm

安装内核

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

设置系统启动顺序

$ cat /boot/grub2/grub.cfg | grep menuentry #查看系统启动项可以发现有最新版本的内核4.16.8-1.el7.elrepo.x86_64

if [ x"${feature_menuentry_id}" = xy ]; then

menuentry_id_option="--id"

menuentry_id_option=""

export menuentry_id_option

menuentry 'CentOS Linux (4.16.8-1.el7.elrepo.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-514.26.2.el7.x86_64-advanced-b7792c31-ad03-4f04-a650-a72e861c892d' {

menuentry 'CentOS Linux (3.10.0-693.21.1.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-514.26.2.el7.x86_64-advanced-b7792c31-ad03-4f04-a650-a72e861c892d' {

menuentry 'CentOS Linux (3.10.0-514.26.2.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-514.26.2.el7.x86_64-advanced-b7792c31-ad03-4f04-a650-a72e861c892d' {

menuentry 'CentOS Linux (3.10.0-514.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-514.el7.x86_64-advanced-b7792c31-ad03-4f04-a650-a72e861c892d' {

menuentry 'CentOS Linux (0-rescue-fbdeed638cd24a09bc5ea0ae945cd465) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-fbdeed638cd24a09bc5ea0ae945cd465-advanced-b7792c31-ad03-4f04-a650-a72e861c892d' {

$ grub2-set-default 'CentOS Linux (4.16.8-1.el7.elrepo.x86_64) 7 (Core)' #设置最新版本内核为默认启动

$ grub2-editenv list #查看默认启动的系统版本

uname -r

你可能感兴趣的:(关于yum升级内核)