1. 更新系统
yum update -y
2.添加elrepo软件源
yum install vim -y
vi /etc/yum.repos.d/elrepo.repo
添加以下内容
[elrepo]
name=elrepo
baseurl=https://mirrors.aliyun.com/elrepo/archive/kernel/el7/x86_64
gpgcheck=0
enabled=1
3. 刷新源数据缓存
yum clean all && yum makecache
4. 安装内核
列出可用内核
[root@centos7 ~]# yum list kernel-lt
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
- base: mirrors.aliyun.com
- extras: mirrors.aliyun.com
- updates: mirrors.aliyun.com
可安装的软件包
kernel-lt.x86_64 5.4.265-1.el7.elrepo elrepo
安装指定内核
yum install -y kernel-lt
5. 查看安装内核版本
awk -F' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
6. 设置默认内核
grub2-set-default 0
7. 重启
reboot
8.验证
uname -r
标签:升级,kernel,mirrors,elrepo,centos7,yum,内核,aliyun From: https://www.cnblogs.com/shaoxintian/p/18466775