最近把服务器从内核3.1升级到5.4内核,发现按传统的安装有时会出现问题,而且在elrepo也没找到所需要的5.4内核…
首先查找kernel rpm历史版本:http://mirrors.coreix.net/elrepo-archive-archive/kernel/el7/x86_64/RPMS/
用wget命令下载到服务器:
wget http://mirrors.coreix.net/elrepo-archive-archive/kernel/el7/x86_64/RPMS/kernel-lt-devel-5.4.278-1.el7.elrepo.x86_64.rpm
wget http://mirrors.coreix.net/elrepo-archive-archive/kernel/el7/x86_64/RPMS/kernel-lt-5.4.278-1.el7.elrepo.x86_64.rpm
安装内核:
rpm -ivh kernel-lt-devel-5.4.278-1.el7.elrepo.x86_64.rpm
rpm -ivh kernel-lt-5.4.278-1.el7.elrepo.x86_64.rpm
使用命令查看已安装的内核:rpm -qa | grep kernel
设置启动:
sudo awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
grub2-set-default 0
生成grub配置文件
grub2-mkconfig -o /boot/grub2/grub.cfg
立即重启reboot -h now
正文完