CentOS7升级kernel内核

参考:我是参考

本文环境centos版本:CentOS Linux release 7.6.1810 (Core)

未升级前内核版本:uname -r 版本:3.10.0-693.21.1.el7.x86_64

当前安装的kernel-devel版本:/usr/src/kernels/3.10.0-957.21.3.el7.x86_64/

升级步骤

1. 更新yum源

yum update

2. 安装grub2(centos7)

yum install kernel grub2

3. 配置grub

  未更改前如下:

[root@tom ~]# cat /etc/default/grub 
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet net.ifnames=0 console=tty0 console=ttyS0,115200n8"
GRUB_DISABLE_RECOVERY="true"

  删除GRUB_CMDLINE_LINUX后面的单词quiet,其他不变

[root@tom ~]# cat /etc/default/grub 
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rhgb net.ifnames=0 console=tty0 console=ttyS0,115200n8"
GRUB_DISABLE_RECOVERY="true"

4. 配置内核启动文件

mkdir /boot/grub
ln -s /boot/grub2/grub.cfg /boot/grub/grub.cfg
grub2-mkconfig -o /boot/grub/grub.cfg
touch /.autorelabel

5. reboot等待重启完成

[root@tom ~]# uname -r
3.10.0-957.21.3.el7.x86_64

 

你可能感兴趣的:(Linux)