JiFu's Wiki JiFu's Wiki
首页
  • HTML
  • JavaScript
  • NodeJS
  • Vuejs
  • 微信小程序
  • Python
  • 数据库
  • 中间件
  • 算法
  • 软件工程
  • Wordpress
  • iOS开发
  • Android开发
  • Linux
  • Windows
  • MacOS
  • Docker
  • Vim
  • VSCode
  • Office
  • 其他
  • Photoshop
  • Sketch
  • Mac
  • 游戏
关于
  • 分类
  • 标签
  • 归档
GitHub (opens new window)
首页
  • HTML
  • JavaScript
  • NodeJS
  • Vuejs
  • 微信小程序
  • Python
  • 数据库
  • 中间件
  • 算法
  • 软件工程
  • Wordpress
  • iOS开发
  • Android开发
  • Linux
  • Windows
  • MacOS
  • Docker
  • Vim
  • VSCode
  • Office
  • 其他
  • Photoshop
  • Sketch
  • Mac
  • 游戏
关于
  • 分类
  • 标签
  • 归档
GitHub (opens new window)
  • DevOps介绍
  • Linux

    • Linux介绍
    • Linux系统目录结构及详细说明
    • 使用SSH登录Google Cloud Platform
    • 生产服务器虚拟化环境搭建大纲
    • 服务器虚拟化环境搭建
    • Ubuntu

    • CentOS

      • Centos介绍
      • CentOS更新ruby版本
      • Centos7修改启动内核,删除无用内核
      • CentOS7编译安装VIM8
      • yum提示Error: rpmdb open failed的解决方案
    • Manjaro

    • Command

    • System Service

  • MacOS

  • Windows

  • Docker

  • Vim

  • VSCode

  • Office

  • 其他

  • 运维
  • Linux
  • CentOS
JiFu
2023-09-13

Centos7修改启动内核,删除无用内核

# 查看系统可用内核

cat /boot/grub2/grub.cfg |grep menuentry

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
  menuentry_id_option=""
export menuentry_id_option
menuentry 'CentOS Linux (3.10.0-514.16.1.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-327.el7.x86_64-advanced-6f5840d0-55ac-4d3b-899b-61c0297c5347' {
menuentry 'CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-327.el7.x86_64-advanced-6f5840d0-55ac-4d3b-899b-61c0297c5347' {
menuentry 'CentOS Linux (0-rescue-d57307c454c0437d91c309347178cdf5) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-d57307c454c0437d91c309347178cdf5-advanced-6f5840d0-55ac-4d3b-899b-61c0297c5347' {
1
2
3
4
5
6
7

# 查看当前内核

uname -r

3.10.0-514.16.1.el7.x86_64
1

# 修改开机时默认使用的内核

grub2-set-default 'CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)'

# 查看内核修改结果

grub2-editenv list

saved_entry=CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)
1

# 查看当前系统已安装的内核

rpm -qa |grep kernel

kernel-3.10.0-327.el7.x86_64
kernel-headers-3.10.0-514.6.1.el7.x86_64
kernel-tools-libs-3.10.0-327.el7.x86_64
kernel-3.10.0-514.16.1.el7.x86_64
kernel-tools-3.10.0-327.el7.x86_64
1
2
3
4
5

# 删除无用内核

yum remove kernel-3.10.0-327.el7.x86_64

# 参考资料

-centos7 选定默认启动内核,及删除无用内核 (opens new window)

#Centos#kernel
上次更新: 2024/08/11, 01:59:03
CentOS更新ruby版本
CentOS7编译安装VIM8

← CentOS更新ruby版本 CentOS7编译安装VIM8→

最近更新
01
Disable notification "to get future google chrome updates you'll need macos 10.13 or later" on mac
05-14
02
MacOS软件推荐
04-30
03
Debian Sway开发机安装手册
03-26
更多文章>
Theme by Vdoing | Copyright © 2019-2025 Ji Fu | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式