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 
相关推荐
MarcoPage1 小时前
Python 字典推导式入门:一行构建键值对映射
java·linux·python
未来之窗软件服务2 小时前
服务器运维(六)跨域配置 Preflight 问题——东方仙化神期
运维·服务器·服务器运维·仙盟创梦ide·东方仙盟
埃伊蟹黄面3 小时前
计算机的“身体”与“灵魂”:冯·诺依曼架构与操作系统
linux
winner88815 小时前
Linux 软件安装 “命令密码本”:yum/apt/brew 一网打尽
linux·运维·服务器
九河云5 小时前
软件开发平台 DevCloud
运维·服务器·数据库·科技·华为云
思麟呀6 小时前
Linux的基础IO流
linux·运维·服务器·开发语言·c++
winner88817 小时前
嵌入式Linux驱动开发全流程:工具协作+核心概念拆解(从入门到理解)
linux·运维·驱动开发
ShiinaKaze7 小时前
fatal error: bits/c++config.h: No such file or directory
linux·gcc·g++
TTBIGDATA7 小时前
【Ambari开启Kerberos】KERBEROS SERVICE CHECK 报错
大数据·运维·hadoop·ambari·cdh·bigtop·ttbigdata
Archy_Wang_17 小时前
脚本自动生成专业Linux巡检报告
linux·运维·服务器