CentOS7 系统升级并删除centos7开机界面多余选项

一:升级系统

1.检查系统版本:

[root@localhost /]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)

2.运行yum命令升级

$ sudo yum clean all
$ sudo yum update

3.重启系统

reboot

4.再次查看系统

[root@localhost /]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)

CentOS更新后并不会自动删除旧内核,故在启动选项中会有多个内核选项。除最新内核和rescue内核外,其余旧内核均可删除,

二:删除Centos7开机界面多余选项

1.查看当前内核版本:

[hongdada@localhost ~]$ uname -a
Linux localhost.localdomain 3.10.0-862.6.3.el7.x86_64 #1 SMP Tue Jun 26 16:32:21 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

2.查看系统中全部的内核rpm包

[hongdada@localhost ~]$ rpm -qa |grep kernel
kernel-tools-libs-3.10.0-862.6.3.el7.x86_64
kernel-3.10.0-862.6.3.el7.x86_64
kernel-3.10.0-693.21.1.el7.x86_64
kernel-tools-3.10.0-862.6.3.el7.x86_64
kernel-3.10.0-327.el7.x86_64
kernel-headers-3.10.0-862.6.3.el7.x86_64

3.删除旧内核的rpm包

[root@localhost hongdada]# yum  remove kernel-3.10.0-327.el7.x86_64
..............
[root@localhost hongdada]# rpm -qa |grep kernel
kernel-tools-libs-3.10.0-862.6.3.el7.x86_64
kernel-3.10.0-862.6.3.el7.x86_64
kernel-3.10.0-693.21.1.el7.x86_64
kernel-tools-3.10.0-862.6.3.el7.x86_64
kernel-headers-3.10.0-862.6.3.el7.x86_64
 
[root@localhost hongdada]# yum remove kernel-3.10.0-693.21.1.el7.x86_64
...............
[root@localhost hongdada]# uname -a
Linux localhost.localdomain 3.10.0-862.6.3.el7.x86_64 #1 SMP Tue Jun 26 16:32:21 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost hongdada]# rpm -qa |grep kernel
kernel-tools-libs-3.10.0-862.6.3.el7.x86_64
kernel-3.10.0-862.6.3.el7.x86_64
kernel-tools-3.10.0-862.6.3.el7.x86_64
kernel-headers-3.10.0-862.6.3.el7.x86_64

4.重启系统

reboot

再次开机,就看见以前4条选项,现在变成了2条选项。

参考:

https://blog.csdn.net/zofia_enjoy/article/details/78487832

https://blog.csdn.net/SweetTool/article/details/72759407

猜你喜欢

转载自www.cnblogs.com/hongdada/p/9298444.html