内核管理
一、查看当前内核版本
[root@centos7-1 ~]# uname -r
3.10.0-1160.6.1.el7.x86_64
内核版本:3.10.0
释出版本:1160 #在主次版本架构不变的情况下,新增的功能累积到一定程度后释出的内核版本
el7:系统版本
x86_64:CPU架构
二、导入ELRepo仓库的公共密钥
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
三、安装ELRepo仓库的yum源
yum install https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm
四、下载新版本内核并安装
yum --enablerepo=elrepo-kernel install kernel-ml
五、查看当前可用的内核
[root@centos7-1 ~]# cat /boot/grub2/grub.cfg |grep menuentry
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
menuentry_id_option=""
export menuentry_id_option
menuentry 'CentOS Linux (5.9.12-1.el7.elrepo.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-693.el7.x86_64-advanced-49d5f3be-6a5c-420d-a05d-04966bf511d5' {
menuentry 'CentOS Linux (3.10.0-1160.6.1.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-693.el7.x86_64-advanced-49d5f3be-6a5c-420d-a05d-04966bf511d5' {
menuentry 'CentOS Linux (3.10.0-693.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-693.el7.x86_64-advanced-49d5f3be-6a5c-420d-a05d-04966bf511d5' {
menuentry 'CentOS Linux (0-rescue-f7f91fc5ff134e879b63da7cb445a1ec) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-f7f91fc5ff134e879b63da7cb445a1ec-advanced-49d5f3be-6a5c-420d-a05d-04966bf511d5' {
六、设置开机时默认启动的内核
grub2-set-default 'CentOS Linux (5.9.12-1.el7.elrepo.x86_64) 7 (Core)'
进行重启,启动时观察内核是否选择为最新版本。