Centos 7 使用国内镜像源更新内核

内核选择参考 此博文 :https://blog.csdn.net/alwaysbefine/article/details/108931626

elrepo官网介绍的内核升级方式为:

一、按文档执行引入 elrepo库;

bash 复制代码
# 1、引入公钥
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

# 2、安装库索引
yum install https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm 

二、按清华镜像站修改镜像源 (https://mirrors.tuna.tsinghua.edu.cn/help/elrepo/

接下来是换源,建议先备份 /etc/yum.repos.d/elrepo.repo

复制代码
sudo cp /etc/yum.repos.d/elrepo.repo /etc/yum.repos.d/elrepo.repo.bak

然后编辑 /etc/yum.repos.d/elrepo.repo 文件,在 mirrorlist= 开头的行前面加 # 注释掉;并将 http://elrepo.org/linux 替换为

复制代码
https://mirrors.tuna.tsinghua.edu.cn/elrepo

最后,更新软件包缓存

复制代码
sudo yum makecache

三、 查询可用内核

bash 复制代码
yum --disablerepo="*" --enablerepo="elrepo-kernel" list available

四、安装内核

bash 复制代码
 yum --enablerepo=elrepo-kernel install kernel-lt -y

安装最新稳定内核,本文试验时 版本为 kernel-lt.x86_64.0.5.4.249-1.el7.elrepo

五、修改grub 设置新内核为启动默认项

bash 复制代码
grub2-set-default 0 && grub2-mkconfig -o /etc/grub2.cfg

六、重启验证

bash 复制代码
reboot 

# 验证内核
uname -r 
相关推荐
甲鱼92914 小时前
MySQL 实战手记:日志管理与主从复制搭建全指南
运维
Johny_Zhao1 天前
OpenClaw安装部署教程
linux·人工智能·ai·云计算·系统运维·openclaw
chlk1233 天前
Linux文件权限完全图解:读懂 ls -l 和 chmod 755 背后的秘密
linux·操作系统
舒一笑3 天前
Ubuntu系统安装CodeX出现问题
linux·后端
改一下配置文件3 天前
Ubuntu24.04安装NVIDIA驱动完整指南(含Secure Boot解决方案)
linux
碳基沙盒3 天前
OpenClaw 多 Agent 配置实战指南
运维
xy123063 天前
OpenStack Train 部署实战(三)控制节点--keystone服务
centos·openstack
深紫色的三北六号3 天前
Linux 服务器磁盘扩容与目录迁移:rsync + bind mount 实现服务无感迁移(无需修改配置)
linux·扩容·服务迁移
SudosuBash3 天前
[CS:APP 3e] 关于对 第 12 章 读/写者的一点思考和题解 (作业 12.19,12.20,12.21)
linux·并发·操作系统(os)
哈基咪怎么可能是AI4 天前
为什么我就想要「线性历史 + Signed Commits」GitHub 却把我当猴耍 🤬🎙️
linux·github