从 Redhat 启动分区卸载旧内核

从 Redhat 启动分区卸载旧内核

接管旧系统后发现/boot分区已满 90%。

在网上搜索后,我发现安装了较旧的内核,占用了磁盘空间。

表演rpm -qa | grep ^kernel | sort节目:

kernel-2.6.9-67.0.15.EL
kernel-2.6.9-67.0.20.EL
kernel-2.6.9-67.0.22.EL
kernel-2.6.9-67.EL
kernel-2.6.9-78.0.13.EL
kernel-2.6.9-78.0.17.EL
kernel-2.6.9-78.0.1.EL
kernel-2.6.9-78.0.22.EL
kernel-2.6.9-78.0.5.EL
kernel-2.6.9-78.0.8.EL
kernel-2.6.9-89.0.11.EL
kernel-2.6.9-89.0.9.EL
kernel-2.6.9-89.31.1.EL
kernel-2.6.9-89.33.1.EL
kernel-2.6.9-89.35.1.EL
kernel-devel-2.6.9-67.0.15.EL
kernel-devel-2.6.9-67.0.20.EL
kernel-devel-2.6.9-67.0.22.EL
kernel-devel-2.6.9-67.EL
kernel-devel-2.6.9-78.0.13.EL
kernel-devel-2.6.9-78.0.17.EL
kernel-devel-2.6.9-78.0.1.EL
kernel-devel-2.6.9-78.0.22.EL
kernel-devel-2.6.9-78.0.5.EL
kernel-devel-2.6.9-78.0.8.EL
kernel-devel-2.6.9-89.0.11.EL
kernel-devel-2.6.9-89.0.7.EL
kernel-devel-2.6.9-89.0.9.EL
kernel-devel-2.6.9-89.31.1.EL
kernel-devel-2.6.9-89.33.1.EL
kernel-devel-2.6.9-89.35.1.EL
kernel-hugemem-devel-2.6.9-67.0.15.EL
kernel-hugemem-devel-2.6.9-67.0.20.EL
kernel-hugemem-devel-2.6.9-67.0.22.EL
kernel-hugemem-devel-2.6.9-67.EL
kernel-hugemem-devel-2.6.9-78.0.13.EL
kernel-hugemem-devel-2.6.9-78.0.17.EL
kernel-hugemem-devel-2.6.9-78.0.1.EL
kernel-hugemem-devel-2.6.9-78.0.22.EL
kernel-hugemem-devel-2.6.9-78.0.5.EL
kernel-hugemem-devel-2.6.9-78.0.8.EL
kernel-hugemem-devel-2.6.9-89.0.11.EL
kernel-hugemem-devel-2.6.9-89.0.7.EL
kernel-hugemem-devel-2.6.9-89.0.9.EL
kernel-hugemem-devel-2.6.9-89.31.1.EL
kernel-hugemem-devel-2.6.9-89.33.1.EL
kernel-hugemem-devel-2.6.9-89.35.1.EL
kernel-smp-2.6.9-67.0.15.EL
kernel-smp-2.6.9-67.0.20.EL
kernel-smp-2.6.9-67.0.22.EL
kernel-smp-2.6.9-67.EL
kernel-smp-2.6.9-78.0.13.EL
kernel-smp-2.6.9-78.0.17.EL
kernel-smp-2.6.9-78.0.1.EL
kernel-smp-2.6.9-78.0.22.EL
kernel-smp-2.6.9-78.0.5.EL
kernel-smp-2.6.9-78.0.8.EL
kernel-smp-2.6.9-89.0.11.EL
kernel-smp-2.6.9-89.0.9.EL
kernel-smp-2.6.9-89.31.1.EL
kernel-smp-2.6.9-89.33.1.EL
kernel-smp-2.6.9-89.35.1.EL
kernel-smp-devel-2.6.9-67.0.15.EL
kernel-smp-devel-2.6.9-67.0.20.EL
kernel-smp-devel-2.6.9-67.0.22.EL
kernel-smp-devel-2.6.9-67.EL
kernel-smp-devel-2.6.9-78.0.13.EL
kernel-smp-devel-2.6.9-78.0.17.EL
kernel-smp-devel-2.6.9-78.0.1.EL
kernel-smp-devel-2.6.9-78.0.22.EL
kernel-smp-devel-2.6.9-78.0.5.EL
kernel-smp-devel-2.6.9-78.0.8.EL
kernel-smp-devel-2.6.9-89.0.11.EL
kernel-smp-devel-2.6.9-89.0.7.EL
kernel-smp-devel-2.6.9-89.0.9.EL
kernel-smp-devel-2.6.9-89.31.1.EL
kernel-smp-devel-2.6.9-89.33.1.EL
kernel-smp-devel-2.6.9-89.35.1.EL
kernel-utils-2.4-20.el4

似乎大家都一致认为我应该删除/卸载旧内核,但作为非系统管理员,我不太清楚该怎么做。我怎么知道要卸载哪些内核,我该怎么做rpm

uname -a显示:

Linux 2.6.9-89.0.11.ELsmp #1 SMP Tue Sep 15 07:16:37 EDT 2009 i686 i686 i386 GNU/Linux

答案1

最安全的做法可能是使用yum erase <package>-<version>。基本上,上面有,但.EL没有必要包含 。rpm -e如果由于某种原因 yum 不可用,您可以使用。

你要非常小心,不要删除当前正在运行的内核。我注意到还有 devel 包。听起来这些对你来说可能完全没有必要,但我建议先删除最旧的版本,直到你对释放的空间量感到满意为止。

Yum 应该会处理这个问题,但也要确认启动项已从 /etc/grub.conf 中删除。

答案2

我本周遇到了这个问题。我发现一个启用了 yum 自动更新的系统。多年来,应用了多个内核更新,最终填满了 /boot。使用 记下您的内核版本uname -a。运行列出已安装的各种内核包。对要删除的版本/包rpm -qa | grep kernel执行。yum erase

[root@xxxx ~]#  rpm -qa | grep kernel
kernel-devel-2.6.9-42.0.8.plus.c4
kernel-smp-2.6.9-42.0.10.EL
kernel-devel-2.6.9-67.0.15.plus.c4
kernel-smp-2.6.9-67.0.20.plus.c4
kernel-devel-2.6.9-89.0.28.plus.c4
kernel-module-xfs-2.6.9-42.0.3.plus.c4smp-0.2-1
kernel-smp-2.6.9-55.plus.c4
kernel-devel-2.6.9-55.0.2.EL
kernel-devel-2.6.9-55.0.2.plus.c4
kernel-smp-2.6.9-55.0.9.plus.c4
kernel-smp-2.6.9-55.0.12.EL
kernel-smp-2.6.9-67.0.1.EL
kernel-devel-2.6.9-67.0.1.EL.plus.c4
kernel-smp-2.6.9-67.0.4.plus.c4
kernel-smp-2.6.9-67.0.7.plus.c4
kernel-devel-2.6.9-67.0.22.plus.c4
kernel-devel-2.6.9-42.0.10.plus.c4
kernel-devel-2.6.9-67.plus.c4
kernel-smp-2.6.9-78.0.13.plus.c4
kernel-smp-2.6.9-89.0.25.plus.c4
kernel-hugemem-devel-2.6.9-89.0.28.plus.c4
kernel-smp-2.6.9-42.0.3.EL
kernel-smp-2.6.9-42.0.3.plus.c4
kernel-smp-2.6.9-42.0.8.EL
kernel-devel-2.6.9-42.0.10.EL

删除几个版本...

yum erase kernel-devel-2.6.9-67.0.4.plus.c4 kernel-devel-2.6.9-67.0.1.EL

相关内容