centos7 内核升级
#查看当前内核:
uname -rs
#升级版本,kernel-lt最新稳定版(5.4):
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
yum --enablerepo=elrepo-kernel install kernel-lt -y
#升级为最新内核(6.0):yum --enablerepo=elrepo-kernel install kernel-ml -y
#重建grub启动菜单:
grub2-mkconfig -o /boot/grub2/grub.cfg
#查看启动项:
awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
#设置默认启动为第一个:
grub2-set-default 0
————————————————————————————————————————————
#离线升级
#下载内核RPM包
https://elrepo.org/linux/kernel/el7/x86_64/RPMS/
#放到/opt/rpm/目录下执行
rpm -ivh kernel-lt-5.4.231-1.el7.elrepo.x86_64.rpm kernel-lt-devel-5.4.231-1.el7.elrepo.x86_64.rpm