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
相关推荐
A小辣椒11 小时前
TShark:Wireshark CLI 功能
linux
A小辣椒14 小时前
TShark:基础知识
linux
AlfredZhao16 小时前
OCI 明明分配了 200G 系统盘,为什么 df 只看到 30G?
linux·oci
AlfredZhao1 天前
vi 删除指定范围的行,不用再反复按 dd
linux·vi
用户9718356334662 天前
银河麒麟 KY10 申威(SW64) 安装 nginx-1.16.1-2.p01.ky10.sw_64.rpm 详细步骤
linux
猪脚踏浪2 天前
linux 拷贝文件或目录到指定的位置
linux
大树882 天前
金刚石散热越强,管路越先见顶
大数据·运维·服务器·人工智能·ai
摇滚侠2 天前
Linux CentOS7 rpm 安装 MySQL 5.7
linux·运维·mysql
霸道流氓气质2 天前
领域驱动设计(DDD)在 Spring Boot 微服务中的实践指南
运维·spring boot·微服务
bush42 天前
嵌入式linux学习记录十四、术语
linux·嵌入式