网站首页 > 教程文章 正文
经常在网上看见说升级内核版本直接用yum updata这个命令,但是这个命令不止会升级内核版本还会升级软件的版本,在生产环境还是慎用这个命令。
查看当前内核版本
[root@localhost ~]# uname -r
3.10.0-957.el7.x86_64
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
启用elrepo仓库
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org #导入ELRepo仓库的公共密钥
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm #安装ELRepo仓库的yum源
升级内核
安装最新版本的内核
yum --enablerepo=elrepo-kernel install kernel-ml
查看系统上所有可用内核
awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
系统内有4个内核,我们要使用刚安装的5.13.7,可用通过grub2-set-default 0 命令或编辑 /etc/default/grub 文件来设置
1.通过grub2-set-default 0设置
0是上面查询出来的可用内核
2.编辑/etc/default/grub文件
设置GRUB_DEFAULT=0
grub2-mkconfig -o /boot/grub2/grub.cfg #生成grub配置文件
然后重启电脑,会发现内核版本已经升级成功了
删除旧内核
rpm -qa | grep kernel
可用使用yum remove来删除对应的rpm包
猜你喜欢
- 2025-07-02 十分钟快速了解一下,如何升级 Linux Kernel
- 2025-07-02 深度操作系统 Deepin V23 安装最新的 linux 内核
- 2025-07-02 Linux又将迎来大版本更新 5.20版可能会被称为Linux 6.0
- 2025-07-02 Linux Kernel 4.5首个候选版本发布
- 2025-07-02 吃瓜:苹果A15芯片或用A14内核的修改版本
- 2025-07-02 新版本降临!Linux内核4.0正式发布
- 2025-07-02 centos7 升级内核版本(centos手动升级内核)
- 2025-07-02 Linux Kernel 4.5 RC6已开放公测:最终版本3月到来
- 2025-07-02 Linux Kernel 4.5系列第4个维护版本发布
- 2025-07-02 360极速浏览器13.0版升级到 Chromium 86内核
- 最近发表
- 标签列表
-
- location.href (44)
- document.ready (36)
- git checkout -b (34)
- 跃点数 (35)
- 阿里云镜像地址 (33)
- qt qmessagebox (36)
- mybatis plus page (35)
- vue @scroll (38)
- 堆栈区别 (33)
- 什么是容器 (33)
- sha1 md5 (33)
- navicat导出数据 (34)
- 阿里云acp考试 (33)
- 阿里云 nacos (34)
- redhat官网下载镜像 (36)
- srs服务器 (33)
- pico开发者 (33)
- https的端口号 (34)
- vscode更改主题 (35)
- 阿里云资源池 (34)
- os.path.join (33)
- redis aof rdb 区别 (33)
- 302跳转 (33)
- http method (35)
- js array splice (33)