Linux内核升级

Background

  • wireguard 内核要求内核版本4.18以上,对于内核版本4.18以下,无法使用WireGuard。
  • 内核版本4.18以上、5.6以下,可以通过升级内核的方式支持WireGuard。
  • 内核5.6及以上版本已经原生支持WireGuard,可以直接使用原生的WireGuard功能。

注意:内核升级有风险,升级失败概不负责,重要数据自行备份❗️❗️❗️

1.载入公钥

sh 复制代码
rpm --import http://www.elrepo.org/RPM-GPG-KEY-elrepo.org

2.升级安装 elrepo

sh 复制代码
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm

3.载入 elrepo-kernel 元数据

sh 复制代码
yum --disablerepo=\* --enablerepo=elrepo-kernel repolist

4.安装最新版本的内核

sh 复制代码
yum --disablerepo=\* --enablerepo=elrepo-kernel install  kernel-ml.x86_64  -y

5.删除旧版本工具包

sh 复制代码
yum remove kernel-tools-libs.x86_64 kernel-tools.x86_64  -y

6.安装新版本工具包

sh 复制代码
yum --disablerepo=\* --enablerepo=elrepo-kernel install kernel-ml-tools kernel-ml-devel kernel-ml-headers -y

7.查看内核插入顺序

sh 复制代码
grep "^menuentry" /boot/grub2/grub.cfg | cut -d "'" -f2

CentOS Linux (6.9.7-1.el7.elrepo.x86_64) 7 (Core)

CentOS Linux (3.10.0-1160.92.1.el7.x86_64) 7 (Core)

CentOS Linux (3.10.0-1160.el7.x86_64) 7 (Core)

CentOS Linux (0-rescue-57beda17722b499da37e22c55c2ef57f) 7 (Core)
默认新内核是从头插入,默认启动顺序也是从 0 开始。

8.查看当前实际启动顺序

sh 复制代码
grub2-editenv list

9.设置默认启动

sh 复制代码
grub2-set-default 'CentOS Linux (6.9.7-1.el7.elrepo.x86_64) 7 (Core)'

10.重启系统

sh 复制代码
reboot

11.查看当前实际启动顺序

sh 复制代码
grub2-editenv list
相关推荐
2301_777998344 小时前
ARP协议进阶:ARP缓存、RARP与ARP欺骗原理解析
linux·服务器·网络·网络协议·缓存
运维行者_5 小时前
应用性能监控怎么选?从调用链到用户体验的五个能力维度
运维·服务器·数据库·人工智能·mysql·性能优化·应用性能监控
考虑考虑9 小时前
nginx路由重写
运维·后端·自动化运维
Zenova EdgeOS11 小时前
Linux 内核日志 dmesg 进阶实战:从现场过滤到持久化闭环
linux·运维·服务器
郝亚军11 小时前
ec_private.pem的生成方法
linux·运维·服务器
NendoZen12 小时前
Arch Linux解决Grub无法SAVEDEFAULT问题(uki启动问题)
linux·运维·服务器
Elastic 中国社区官方博客13 小时前
Elasticsearch:安装自行管理的 Elastic Stack 集群
大数据·运维·服务器·数据库·elasticsearch·搜索引擎·全文检索
忆挽篱笙歌13 小时前
进程控制管理
linux·运维·服务器
Escalating_xu13 小时前
【Linux 网络编程】connect 的断线重连:用状态机写一个能恢复连接的 TCP 客户端
linux·网络·tcp/ip
Zucker n15 小时前
英语“论文”语法检查工具
linux·windows