Fedora清除旧内核,方法如下:
1. 查看当前系统中已安装的内核相关包:
[iceting@localhost ~]$ rpm -qa |grep kernel
abrt-addon-kerneloops-2.2.0-1.fc20.x86_64
kernel-headers-3.13.10-200.fc20.x86_64
libreport-plugin-kerneloops-2.2.1-1.fc20.x86_64
kernel-debug-devel-3.13.10-200.fc20.x86_64
kernel-3.13.10-200.fc20.x86_64
kernel-modules-extra-3.11.10-301.fc20.x86_64
kernel-modules-extra-3.13.10-200.fc20.x86_64
kernel-3.11.10-301.fc20.x86_64
2.查看当前系统内核
[iceting@localhost ~]$ sudo uname -r
3.13.10-200.fc20.x86_64
3. 确定要删除的内核:
这里为:kernel-3.11.10-301.fc20.x86_64
4. 删除内核:
[iceting@localhost ~]$ sudo yum remove kernel-3.11.10-301.fc20.x86_64
已加载插件:langpacks, refresh-packagekit
Repository fedora is listed more than once in the configuration
Repository fedora-debuginfo is listed more than once in the configuration
Repository fedora-source is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository updates-debuginfo is listed more than once in the configuration
Repository updates-source is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository updates-debuginfo is listed more than once in the configuration
Repository updates-source is listed more than once in the configuration
Repository fedora is listed more than once in the configuration
Repository fedora-debuginfo is listed more than once in the configuration
Repository fedora-source is listed more than once in the configuration
正在解决依赖关系
--> 正在检查事务
---> 软件包 kernel.x86_64.0.3.11.10-301.fc20 将被 删除
--> 正在处理依赖关系 kernel-uname-r = 3.11.10-301.fc20.x86_64,它被软件包 kernel-modules-extra-3.11.10-301.fc20.x86_64 需要
--> 正在检查事务
---> 软件包 kernel-modules-extra.x86_64.0.3.11.10-301.fc20 将被 删除
--> 解决依赖关系完成
依赖关系解决
================================================================================
Package 架构 版本 源 大小
================================================================================
正在删除:
kernel x86_64 3.11.10-301.fc20 @anaconda 128 M
为依赖而移除:
kernel-modules-extra x86_64 3.11.10-301.fc20 @anaconda 8.1 M
事务概要
================================================================================
移除 1 软件包 (+1 依赖软件包)
安装大小:136 M
是否继续?[y/N]:y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在删除 : kernel-modules-extra-3.11.10-301.fc20.x86_64 1/2
正在删除 : kernel-3.11.10-301.fc20.x86_64 2/2
验证中 : kernel-modules-extra-3.11.10-301.fc20.x86_64 1/2
验证中 : kernel-3.11.10-301.fc20.x86_64 2/2
删除:
kernel.x86_64 0:3.11.10-301.fc20
作为依赖被删除:
kernel-modules-extra.x86_64 0:3.11.10-301.fc20
完毕!
[iceting@localhost ~]$
没有直接使用: rpm -e 的方法删除内核包, 而是使用 yum remove 进行删除,
因为使用yum remove删除, yum 会自动移除 : /boot/grub/menu.lst 中的相关启动项。