离线升级
首先找到镜像网址:http://elrepo.org/tiki/Download
我选择了 https://mirrors.tuna.tsinghua.edu.cn/elrepo/kernel/el7/x86_64/RPMS/
下载安装包
wget https://mirrors.tuna.tsinghua.edu.cn/elrepo/kernel/el7/x86_64/RPMS/elrepo-release-7.0-6.el7.elrepo.noarch.rpm
wget https://mirrors.tuna.tsinghua.edu.cn/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-6.8.1-1.el7.elrepo.x86_64.rpm
wget https://mirrors.tuna.tsinghua.edu.cn/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-devel-6.8.1-1.el7.elrepo.x86_64.rpm
wget https://mirrors.tuna.tsinghua.edu.cn/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-doc-6.8.1-1.el7.elrepo.noarch.rpm
wget https://mirrors.tuna.tsinghua.edu.cn/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-tools-6.8.1-1.el7.elrepo.x86_64.rpm
wget https://mirrors.tuna.tsinghua.edu.cn/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-tools-libs-6.8.1-1.el7.elrepo.x86_64.rpm
wget https://mirrors.tuna.tsinghua.edu.cn/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-tools-libs-devel-6.8.1-1.el7.elrepo.x86_64.rpm
wget https://mirrors.tuna.tsinghua.edu.cn/elrepo/kernel/el7/x86_64/RPMS/perf-5.4.272-1.el7.elrepo.x86_64.rpm
wget https://mirrors.tuna.tsinghua.edu.cn/elrepo/kernel/el7/x86_64/RPMS/python-perf-5.4.272-1.el7.elrepo.x86_64.rpm
安装过程
# 先删除旧的,先安装 kernel-ml-tools-libs,否则会报错 依赖关系 libcpupower.so.1
[root@i-606384EF ~]# yum remove kernel-tools-libs.x86_64 kernel-tools.x86_64
[root@i-606384EF ~]# rpm -iv elrepo-release-7.0-6.el7.elrepo.noarch.rpm
[root@i-606384EF ~]# rpm -iv --percent kernel-ml-devel-6.8.1-1.el7.elrepo.x86_64.rpm
[root@i-606384EF ~]# rpm -iv --percent kernel-ml-headers-6.8.1-1.el7.elrepo.x86_64.rpm
[root@i-606384EF ~]# rpm -iv --percent kernel-ml-tools-libs-6.8.1-1.el7.elrepo.x86_64.rpm
[root@i-606384EF ~]# rpm -iv --percent kernel-ml-tools-6.8.1-1.el7.elrepo.x86_64.rpm
[root@i-606384EF ~]# rpm -iv --percent kernel-ml-tools-libs-devel-6.8.1-1.el7.elrepo.x86_64.rpm
# 如果需要 perf,
# rpm install perf
# rpm -iUvh perf-5.4.272-1.el7.elrepo.x86_64.rpm python-perf-5.4.272-1.el7.elrepo.x86_64.rpm
# 最后安装内核
[root@i-606384EF ~]# rpm -iv --percent kernel-ml-6.8.1-1.el7.elrepo.x86_64.rpm
# 验证
[root@i-606384EF ~]# awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
0 : CentOS Linux (6.8.1-1.el7.elrepo.x86_64) 7 (Core)
1 : CentOS Linux (3.10.0-1160.102.1.el7.x86_64) 7 (Core)
2 : CentOS Linux (0-rescue-5987de640e6d4ac9b69d19e0059df86e) 7 (Core)
# 设置启动选项
[root@i-606384EF ~]# grub2-set-default "CentOS Linux (6.8.1-1.el7.elrepo.x86_64) 7 (Core)"
#重启
[root@i-606384EF ~]# shutdown -r now
检查
[root@i-606384EF ~]# uname -a
Linux i-606384EF 6.8.1-1.el7.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Mar 15 15:39:22 EDT 2024 x86_64 x86_64 x86_64 GNU/Linux
[root@i-606384EF ~]# rpm -qa | grep kernel
kernel-3.10.0-1062.el7.x86_64
kernel-ml-tools-libs-6.8.1-1.el7.elrepo.x86_64
kernel-ml-tools-libs-devel-6.8.1-1.el7.elrepo.x86_64
kernel-ml-6.8.1-1.el7.elrepo.x86_64
kernel-ml-tools-6.8.1-1.el7.elrepo.x86_64
kernel-ml-headers-6.8.1-1.el7.elrepo.x86_64
问题记录
先安装 kernel-ml-tools-libs,否则会报错 依赖关系 libcpupower.so.1
--> 正在检查事务
---> 软件包 kernel-ml-tools.x86_64.0.6.8.1-1.el7.elrepo 将被 安装
--> 正在处理依赖关系 kernel-ml-tools-libs = 6.8.1-1.el7.elrepo,它被软件包 kernel-ml-tools-6.8.1-1.el7.elrepo.x86_64 需要
--> 正在处理依赖关系 libcpupower.so.1()(64bit),它被软件包 kernel-ml-tools-6.8.1-1.el7.elrepo.x86_64 需要
--> 正在检查事务
---> 软件包 kernel-ml-tools-libs.x86_64.0.6.8.1-1.el7.elrepo 将被 安装
--> 解决依赖关系完成
依赖关系解决
================================================================================Package 架构 版本 源 大小
================================================================================
正在安装:kernel-ml-tools x86_64 6.8.1-1.el7.elrepo elrepo-kernel 312 k
为依赖而安装:kernel-ml-tools-libs x86_64 6.8.1-1.el7.elrepo elrepo-kernel 193 k