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 
相关推荐
2301_794333917 分钟前
实验室服务器配置|通过Docker实现Linux系统多用户隔离与安全防控
linux·服务器·docker·实验室
打码人的日常分享28 分钟前
运维服务方案,运维巡检方案,运维安全保障方案文件
大数据·运维·安全·word·安全架构
荣光波比1 小时前
Nginx 实战系列(一)—— Web 核心概念、HTTP/HTTPS协议 与 Nginx 安装
linux·运维·服务器·nginx·云计算
武文斌771 小时前
单片机:DS18B20测温度、74HC595扩展芯片、8*8LED矩阵
运维·服务器·单片机·嵌入式硬件
fengfuyao9852 小时前
诊断并修复SSH连接Github时遇到的“connection closed“错误
运维·ssh·github
scugxl2 小时前
centos7 docker离线安装
运维·docker·容器
绿箭柠檬茶4 小时前
Ubuntu 使用 Samba 共享文件夹
linux·运维·ubuntu
工藤新一¹5 小时前
Linux —— 虚拟进程地址空间
linux·运维·服务器·c/c++·虚拟进程地址空间
Aspiresky5 小时前
浅析Linux内核scatter-gather list实现
linux·dma·scatter/gather
奔跑吧 android5 小时前
【linux kernel 常用数据结构和设计模式】【数据结构 3】【模拟input子系统input_dev和input_handler之间的多对多关系】
linux·数据结构·input·kernel·input_dev·input_handler·input_handle