用yum升级centos7系统内核

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/s295580857/article/details/80336916
  • 导入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  #查看默认启动的系统版本
saved_entry=CentOS Linux (4.16.8-1.el7.elrepo.x86_64) 7 (Core)
  • 重启系统并查看
$ init 6
$ uname -r  #查看新系统内核版本
阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页