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 
相关推荐
likfishdn9 分钟前
Linux的文件与目录管理
linux·运维·服务器
chian-ocean28 分钟前
Linux 文件缓冲区:高效数据访问的幕后推手
linux·运维·服务器
加油=^_^=30 分钟前
【Linux】进程优先级 | 进程调度(三)
linux·运维·服务器
吃汤圆的抹香鲸1 小时前
GoLand 安装包 绿色版 Win,Mac,Linux 包含IntelliJ全家桶 专为Go语言设计的集成开发环境(IDE)
linux·windows·macos·go·intellij-idea·go1.19
追寻光1 小时前
Cannot find a valid baseurl for repo: base/7/x86_64
linux
元气满满的热码式1 小时前
Docker数据卷操作实战
linux·运维·docker·云原生·容器
陆沙1 小时前
deepseek-r1-centos-本地服务器配置方法
linux·服务器·centos
北京耐用通信1 小时前
航空装配自动化神器Ethercat转profient网关搭配机器人精准控制
运维·机器人·自动化
吃汤圆的抹香鲸2 小时前
Rider 安装包 绿色版 Win/Mac/Linux 适合.NET和游戏开发者使用 2025全栈开发终极指南:从零配置到企业级实战
linux·运维·windows·sql·游戏·macos·.net
sz66cm2 小时前
Linux基础 -- ARM 32 位架构动态注入代码技术文档
linux·arm开发·架构