当前位置: 首页 > article >正文

Linux 默认内核版本更改

随笔记录

目录

1. 背景介绍

2. 解决方法

2.1 查看所有可用版本

2.2  安装指定版本内核

2.3 检查当前内核列表

2.4 检查当前默认内核

2.5 设置新的默认内核 

2.6 确认内核是否成功加载

2.7 重启 

2.8 删除其他版本内核


1. 背景介绍

linux 一般安装多个内核版本,但会设置一个开机启动默认内核版本。

如果需要升级内核版本,且找不到需要升级的内核版本时,可通过更改默认内核版本解决。

2. 解决方法

2.1 查看所有可用版本

# 查看所有可用版本

yum list kernel --showduplicates


[root@localhost ~]#
[root@localhost ~]# yum list kernel --showduplicates
Repository base is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository PowerTools is listed more than once in the configuration
Repository AppStream is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Last metadata expiration check: 1:16:35 ago on Sun 29 Sep 2024 08:39:22 AM CST.
Installed Packages
kernel.x86_64                                                    4.18.0-373.el8                                                           @baseos
kernel.x86_64                                                    4.18.0-408.el8                                                           @anaconda
kernel.x86_64                                                    4.18.0-553.5.1.el8                                                       @baseos
Available Packages
kernel.x86_64                                                    4.18.0-348.el8                                                           base
kernel.x86_64                                                    4.18.0-348.2.1.el8_5                                                     base
kernel.x86_64                                                    4.18.0-348.7.1.el8_5                                                     base
kernel.x86_64                                                    4.18.0-552.el8                                                           baseos
kernel.x86_64                                                    4.18.0-552.1.1.el8                                                       baseos
kernel.x86_64                                                    4.18.0-552.3.1.el8                                                       baseos
kernel.x86_64                                                    4.18.0-553.5.1.el8                                                       baseos
kernel.x86_64                                                    4.18.0-553.6.1.el8                                                       baseos
[root@localhost ~]#
[root@localhost ~]#

 

2.2  安装指定版本内核

可以下载安装指定内核版本,也可以直接使用现有内核版本设置为默认内核

# 安装指定版本内核
yum install kernel kernel-4.18.0-373.el8.x86_64 -y

2.3 检查当前内核列表

# 检查当前内核列表

grubby --info=ALL | grep ^kernel

[root@localhost ~]#
[root@localhost ~]# grubby --info=ALL | grep ^kernel

kernel="/boot/vmlinuz-4.18.0-553.5.1.el8.x86_64"
kernel="/boot/vmlinuz-4.18.0-408.el8.x86_64"
kernel="/boot/vmlinuz-4.18.0-373.el8.x86_64"
kernel="/boot/vmlinuz-0-rescue-dcf1251e2ffb44dfa5f6567c29d0c6d7"
[root@localhost ~]#

 

2.4 检查当前默认内核

# 检查当前默认内核
grubby --default-kernel

2.5 设置新的默认内核 

# 设置新的默认内核
grubby --set-default "/boot/vmlinuz-4.18.0-373.el8.x86_64"

2.6 确认内核是否成功加载

# 确认内核是否成功加载

grubby --default-kernel


[root@localhost ~]#
[root@localhost ~]# grubby --default-kernel
/boot/vmlinuz-4.18.0-553.5.1.el8.x86_64
[root@localhost ~]#
[root@localhost ~]#

2.7 重启 

# reboot

2.8 删除其他版本内核

# 删除其他版本内核


yum remove kernel kernel-4.18.0-407.el8.x86_64 -y

到此Linux 内核常规问题已解决


http://www.kler.cn/news/334744.html

相关文章:

  • 模型无关的局部解释(LIME)技术原理解析及多领域应用实践
  • SVM及其实践1 --- 概念、理论以及二分类实践
  • 速速收藏!这些2024年上映的AI电影与短剧,申请加入你的国庆假期宅家计划!
  • Flask-3
  • github项目——gpt-pilot自动创建应用
  • 一个真实可用的登录界面!
  • thinkphp6入门(25)-- 分组查询 GROUP_CONCAT
  • C#串口温度读取
  • Spring Boot框架下的足球青训俱乐部后台开发
  • 【前沿 热点 顶会】NIPS 2024中目标检测有关的论文
  • 【报错】mac m1 gateway 报错
  • Prompt 模版解析:诗人角色的创意引导与实践
  • 3.JVM
  • 技术人生-AD域
  • 论文 | Model-tuning Via Prompts Makes NLP Models Adversarially Robust
  • 自动驾驶系列—自动驾驶背后的数据通道:通信总线技术详解与应用场景分析
  • 银河麒麟桌面操作系统V10 SP1:取消安装应用的安全授权认证
  • Python和C++及MATLAB和R时间序列中数学物理金融气象运动和电子材料
  • (C语言贪吃蛇)16.贪吃蛇食物位置随机(完结撒花)
  • Linux进程调度和进程切换