将Centos 8 Linux内核版本升级或降级到指定版本

本文以centos 8.0为例,内核版本为4.18.0-80.el8.x86_64,升级到内核版本为4.18.0-80.4.2.el8_0.x86_64。

1.查看当前系统版本信息

cpp 复制代码
[root@centos80-1905 ~]# uname -sr
Linux 4.18.0-80.el8.x86_64

2.在网站:https://vault.centos.org/里面下载Binary package二进制包

路径为:https://vault.centos.org/8.0.1905/BaseOS/x86_64/os/Packages/

3.按Ctrl+f在页面上进行查找,输入kernel,一路回车,找到你需要的kernel版本。

这里我需要的是4.18.0-80.4.2.el8_0.x86_64,点击,对应的rpm包就被下载到电脑上了。

4.将三个rpm包上传到centos 8系统中。

c 复制代码
total 45028
-rw-------. 1 root root     1274 May 30  2023 anaconda-ks.cfg
-rw-r--r--. 1 root root   419544 Aug 13 16:45 kernel-4.18.0-80.4.2.el8_0.x86_64.rpm
-rw-r--r--. 1 root root 24766716 Aug 13 16:46 kernel-core-4.18.0-80.4.2.el8_0.x86_64.rpm
-rw-r--r--. 1 root root 20912504 Aug 13 16:54 kernel-modules-4.18.0-80.4.2.el8_0.x86_64.rpm

5.安装rpm包

c 复制代码
[root@centos80-1905 ~]# yum install kernel-*
Failed to set locale, defaulting to C
CentOS-8 - Extras                                                                                                                    0.0  B/s |   0  B     00:01
Failed to synchronize cache for repo 'extras', ignoring this repo.
Last metadata expiration check: 0:08:50 ago on Tue Aug 13 16:45:45 2024.
Dependencies resolved.
=====================================================================================================================================================================
 Package                                 Arch                            Version                                         Repository                             Size
=====================================================================================================================================================================
Installing:
 kernel                                  x86_64                          4.18.0-80.4.2.el8_0                             @commandline                          410 k
 kernel-core                             x86_64                          4.18.0-80.4.2.el8_0                             @commandline                           24 M
 kernel-modules                          x86_64                          4.18.0-80.4.2.el8_0                             @commandline                           20 M

Transaction Summary
=====================================================================================================================================================================
Install  3 Packages

Total size: 44 M
Installed size: 76 M
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                             1/1
  Installing       : kernel-core-4.18.0-80.4.2.el8_0.x86_64                                                                                                      1/3
  Running scriptlet: kernel-core-4.18.0-80.4.2.el8_0.x86_64                                                                                                      1/3
  Installing       : kernel-modules-4.18.0-80.4.2.el8_0.x86_64                                                                                                   2/3
  Running scriptlet: kernel-modules-4.18.0-80.4.2.el8_0.x86_64                                                                                                   2/3
  Installing       : kernel-4.18.0-80.4.2.el8_0.x86_64                                                                                                           3/3
  Running scriptlet: kernel-core-4.18.0-80.4.2.el8_0.x86_64                                                                                                      3/3
  Running scriptlet: kernel-4.18.0-80.4.2.el8_0.x86_64                                                                                                           3/3
  Verifying        : kernel-4.18.0-80.4.2.el8_0.x86_64                                                                                                           1/3
  Verifying        : kernel-core-4.18.0-80.4.2.el8_0.x86_64                                                                                                      2/3
  Verifying        : kernel-modules-4.18.0-80.4.2.el8_0.x86_64                                                                                                   3/3

Installed:
  kernel-4.18.0-80.4.2.el8_0.x86_64                 kernel-core-4.18.0-80.4.2.el8_0.x86_64                 kernel-modules-4.18.0-80.4.2.el8_0.x86_64

Complete!

6.重启系统,查看系统内核是否升级成功。

c 复制代码
[root@centos80-1905 ~]# reboot
[root@centos80-1905 ~]# uname -sr
Linux 4.18.0-80.4.2.el8_0.x86_64
相关推荐
Chuncheng's blog1 小时前
RedHat7 如何更换yum镜像源
linux
爱莉希雅&&&1 小时前
shell脚本之条件判断,循环控制,exit详解
linux·运维·服务器·ssh
wei_work@1 小时前
【linux】Web服务—搭建nginx+ssl的加密认证web服务器
linux·服务器·ssl
扶尔魔ocy2 小时前
【Linux C/C++开发】轻量级关系型数据库SQLite开发(包含性能测试代码)
linux·数据库·c++·sqlite
Sylvan Ding2 小时前
远程主机状态监控-GPU服务器状态监控-深度学习服务器状态监控
运维·服务器·深度学习·监控·远程·gpu状态
追赶sun3 小时前
Ubuntu 添加系统调用
linux·ubuntu·操作系统·系统调用
北漂老男孩3 小时前
在 Linux 上安装 MATLAB:完整指南与疑难解决方案
linux·运维·matlab
Why not try?!3 小时前
Centos7 中 Docker运行配置Apache
运维·docker·容器
杰克逊的日记3 小时前
Flink运维要点
大数据·运维·flink
hnlucky4 小时前
如何彻底清空docker里面不使用的容器?
运维·docker·容器