赞
踩
Centos8系统中有两个内核版本,一个是5.4.172,另一个是4.18.0如下图:
比如需要删除多余的5.4.172内核。
-1,查看当前系统的内核版本号
使用命令:uname -r
如下:
[jn@localhost ~]$ uname -r
4.18.0-348.7.1.el8_5.x86_64
[jn@localhost ~]$
-2,查找点前系统上存在的内核
使用命令:rpm -qa | grep kernel
如下:
[jn@localhost ~]$ rpm -qa | grep kernel
kernel-headers-4.18.0-348.7.1.el8_5.x86_64
kernel-4.18.0-348.7.1.el8_5.x86_64
kernel-tools-libs-4.18.0-348.7.1.el8_5.x86_64
kernel-lt-5.4.172-1.el8.elrepo.x86_64
kernel-core-4.18.0-193.el8.x86_64
kernel-lt-core-5.4.172-1.el8.elrepo.x86_64
kernel-tools-4.18.0-348.7.1.el8_5.x86_64
kernel-4.18.0-193.el8.x86_64
kernel-lt-devel-5.4.172-1.el8.elrepo.x86_64
kernel-modules-4.18.0-348.7.1.el8_5.x86_64
kernel-devel-4.18.0-348.7.1.el8_5.x86_64
kernel-core-4.18.0-348.7.1.el8_5.x86_64
kernel-lt-modules-5.4.172-1.el8.elrepo.x86_64
kernel-modules-4.18.0-193.el8.x86_64
[jn@localhost ~]$
-3,移除多余的内核版本
使用命令:yum remove kernel-XXXXXXXXX
如下:
[jn@localhost ~]$ sudo yum remove kernel-lt-5.4.172-1.el8.elrepo.x86_64
[sudo] jn 的密码:
依赖关系解决。
=====================================================================
软件包 架构 版本 仓库 大小
=====================================================================
移除:
kernel-lt x86_64 5.4.172-1.el8.elrepo @elrepo-kernel 0
清除未被使用的依赖关系:
kernel-lt-core x86_64 5.4.172-1.el8.elrepo @elrepo-kernel 63 M
kernel-lt-modules x86_64 5.4.172-1.el8.elrepo @elrepo-kernel 24 M
事务概要
====================================================================
移除 3 软件包
将会释放空间:87 M
确定吗?[y/N]: y
运行事务检查
事务检查成功。
运行事务测试
事务测试成功。
运行事务
准备中 : 1/1
删除 : kernel-lt-5.4.172-1.el8.elrepo.x86_64 1/3
删除 : kernel-lt-modules-5.4.172-1.el8.elrepo.x86_64 2/3
运行脚本: kernel-lt-modules-5.4.172-1.el8.elrepo.x86_64 2/3
运行脚本: kernel-lt-core-5.4.172-1.el8.elrepo.x86_64 3/3
dkms: removing: nvidia 470.94 (5.4.172-1.el8.elrepo.x86_64) (x86_64)
Module nvidia-470.94 for kernel 5.4.172-1.el8.elrepo.x86_64 (x86_64).
Before uninstall, this module version was ACTIVE on this kernel.
Removing any linked weak-modules
depmod: WARNING: /lib/modules/5.4.172-1.el8.elrepo.x86_64/kernel/drivers/rtc/rtc-hid-sensor-time.ko.xz needs unknown symbol hid_sensor_parse_common_attributes
depmod: WARNING: /lib/modules/5.4.172-1.el8.elrepo.x86_64/kernel/drivers/hwmon/iio_hwmon.ko.xz needs unknown symbol iio_get_channel_type
depmod: WARNING: /lib/modules/5.4.172-1.el8.elrepo.x86_64/kernel/drivers/hwmon/iio_hwmon.ko.xz needs unknown symbol devm_iio_channel_get_all
depmod: WARNING: /lib/modules/5.4.172-1.el8.elrepo.x86_64/kernel/drivers/hwmon/iio_hwmon.ko.xz needs unknown symbol iio_read_channel_processed
depmod: WARNING: /lib/modules/5.4.172-1.el8.elrepo.x86_64/kernel/drivers/crypto/chelsio/chtls/chtls.ko.xz needs unknown symbol cxgb4_create_server
depmod: WARNING: /lib/modules/5.4.172-1.el8.elrepo.x86_64/kernel/drivers/crypto/chelsio/chtls/chtls.ko.xz needs unknown symbol cxgb4_l2t_get
depmod: WARNING: /lib/modules/5.4.172-1.el8.elrepo.x86_64/kernel/drivers/crypto/chelsio/chtls/chtls.ko.xz needs unknown symbol cxgb4_pktgl_to_skb
depmod: WARNING: /lib/modules/5.4.172-1.el8.elrepo.x86_64/kernel/drivers/crypto/chelsio/chtls/chtls.ko.xz needs unknown symbol cxgb4_port_idx
depmod: WARNING: /lib/modules/5.4.172-1.el8.elrepo.x86_64/kernel/drivers/crypto/chelsio/chtls/chtls.ko.xz needs unknown symbol cxgb4_best_aligned_mtu
depmod: WARNING: /lib/modules/5.4.172-1.el8.elrepo.x86_64/kernel/drivers/crypto/chelsio/chtls/chtls.ko.xz needs unknown symbol cxgb4_register_uld
depmod: WARNING: /lib/modules/5.4.172-1.el8.elrepo.x86_64/kernel/drivers/crypto/chelsio/chtls/chtls.ko.xz needs unknown symbol cxgb4_remove_server
depmod: WARNING: /lib/modules/5.4.172-1.el8.elrepo.x86_64/kernel/drivers/crypto/chelsio/chtls/chtls.ko.xz needs unknown symbol cxgb4_l2t_send
depmod: WARNING: /lib/modules/5.4.172-1.el8.elrepo.x86_64/kernel/drivers/crypto/chelsio/chtls/chtls.ko.xz needs unknown symbol cxgb4_port_viid
depmod: WARNING: /lib/modules/5.4.172-1.el8.elrepo.x86_64/kernel/drivers/crypto/chelsio/chtls/chtls.ko.xz needs unknown symbol cxgb4_alloc_stid
depmod: WARNING: /lib/modules/5.4.172-1.el8.elrepo.x86_64/kernel/drivers/crypto/chelsio/chtls/chtls.ko.xz needs unknown symbol cxgb4_ofld_send
depmod: WARNING: /lib/modules/5.4.172-1.el8.elrepo.x86_64/kernel/drivers/crypto/chelsio/chtls/chtls.ko.xz needs unknown symbol cxgb4_remove_tid
depmod: WARNING: /lib/modules/5.4.172-1.el8.elrepo.x86_64/kernel/drivers/crypto/chelsio/chtls/chtls.ko.xz needs unknown symbol cxgb4_port_chan
depmod: WARNING: /lib/modules/5.4.172-1.el8.elrepo.x86_64/kernel/drivers/crypto/chelsio/chtls/chtls.ko.xz needs unknown symbol cxgb4_immdata_send
depmod: WARNING: /lib/modules/5.4.172-1.el8.elrepo.x86_64/kernel/drivers/crypto/chelsio/chtls/chtls.ko.xz needs unknown symbol cxgb4_unregister_uld
depmod: WARNING: /lib/modules/5.4.172-1.el8.elrepo.x86_64/kernel/drivers/crypto/chelsio/chtls/chtls.ko.xz needs unknown symbol cxgb4_free_stid
depmod: WARNING: /lib/modules/5.4.172-1.el8.elrepo.x86_64/kernel/drivers/crypto/chelsio/chtls/chtls.ko.xz needs unknown symbol cxgb4_l2t_release
depmod: WARNING: /lib/modules/5.4.172-1.el8.elrepo.x86_64/kernel/drivers/hid/hid-asus.ko.xz needs unknown symbol asus_wmi_evaluate_method
nvidia.ko.xz:
- Uninstallation
- Deleting from: /lib/modules/5.4.172-1.el8.elrepo.x86_64/extra/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
nvidia-uvm.ko.xz:
- Uninstallation
- Deleting from: /lib/modules/5.4.172-1.el8.elrepo.x86_64/extra/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
nvidia-modeset.ko.xz:
- Uninstallation
- Deleting from: /lib/modules/5.4.172-1.el8.elrepo.x86_64/extra/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
nvidia-drm.ko.xz:
- Uninstallation
- Deleting from: /lib/modules/5.4.172-1.el8.elrepo.x86_64/extra/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
nvidia-peermem.ko.xz:
- Uninstallation
- Deleting from: /lib/modules/5.4.172-1.el8.elrepo.x86_64/extra/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
depmod...
删除 : kernel-lt-core-5.4.172-1.el8.elrepo.x86_64 3/3
警告:文件 /lib/modules/5.4.172-1.el8.elrepo.x86_64/updates:移除失败:没有那个文件或目录
运行脚本: kernel-lt-core-5.4.172-1.el8.elrepo.x86_64 3/3
验证 : kernel-lt-5.4.172-1.el8.elrepo.x86_64 1/3
验证 : kernel-lt-core-5.4.172-1.el8.elrepo.x86_64 2/3
验证 : kernel-lt-modules-5.4.172-1.el8.elrepo.x86_64 3/3
已更新安装的产品。
已移除:
kernel-lt-5.4.172-1.el8.elrepo.x86_64 kernel-lt-core-5.4.172-1.el8.elrepo.x86_64 kernel-lt-modules-5.4.172-1.el8.elrepo.x86_64
完毕!
[hl@localhost ~]$ rpm -qa | grep kernel
kernel-headers-4.18.0-348.7.1.el8_5.x86_64
kernel-4.18.0-348.7.1.el8_5.x86_64
kernel-tools-libs-4.18.0-348.7.1.el8_5.x86_64
kernel-core-4.18.0-193.el8.x86_64
kernel-tools-4.18.0-348.7.1.el8_5.x86_64
kernel-4.18.0-193.el8.x86_64
kernel-lt-devel-5.4.172-1.el8.elrepo.x86_64
kernel-modules-4.18.0-348.7.1.el8_5.x86_64
kernel-devel-4.18.0-348.7.1.el8_5.x86_64
kernel-core-4.18.0-348.7.1.el8_5.x86_64
kernel-modules-4.18.0-193.el8.x86_64
[hl@localhost ~]$ sudo yum remove kernel-lt-devel-5.4.172-1.el8.elrepo.x86_64
依赖关系解决。
=============================================================================
软件包 架构 版本 仓库 大小
=============================================================================
移除:
kernel-lt-devel x86_64 5.4.172-1.el8.elrepo @elrepo-kernel 49 M
事务概要
=============================================================================
移除 1 软件包
将会释放空间:49 M
确定吗?[y/N]: y
运行事务检查
事务检查成功。
运行事务测试
事务测试成功。
运行事务
准备中 : 1/1
删除 : kernel-lt-devel-5.4.172-1.el8.elrepo.x86_64 1/1
验证 : kernel-lt-devel-5.4.172-1.el8.elrepo.x86_64 1/1
已更新安装的产品。
已移除:
kernel-lt-devel-5.4.172-1.el8.elrepo.x86_64
完毕!
查询否把5.4.172内核删掉:
[jn@localhost ~]$ rpm -qa | grep kernel
kernel-headers-4.18.0-348.7.1.el8_5.x86_64
kernel-4.18.0-348.7.1.el8_5.x86_64
kernel-tools-libs-4.18.0-348.7.1.el8_5.x86_64
kernel-core-4.18.0-193.el8.x86_64
kernel-tools-4.18.0-348.7.1.el8_5.x86_64
kernel-4.18.0-193.el8.x86_64
kernel-modules-4.18.0-348.7.1.el8_5.x86_64
kernel-devel-4.18.0-348.7.1.el8_5.x86_64
kernel-core-4.18.0-348.7.1.el8_5.x86_64
kernel-modules-4.18.0-193.el8.x86_64
[jn@localhost ~]$
如上已经删掉5.4.172内核!
-4,重启
采用如下命令重启:
$ sudo reboot
重启之后5.4.172内核版已经消失,如下图:
注意:不需要再修改grub.conf文件!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。