Linux卸载旧版本内核
1、查询当前操作系统中已经安装的内核版本:rpm -qa | grep kernel*
# rpm -qa | grep kernel*
kernel-3.10.0-1127.el7.x86_64 (旧版内核)
kernel-uek-4.14.35-1902.300.11.el7uek.x86_64 (新版内核)
kernel-tools-libs-3.10.0-1127.el7.x86_64 (旧版内核插件包)
kernel-tools-3.10.0-1127.el7.x86_64 (旧版内核插件包)
2、卸载内核:rpm -e
或yum remove
包名
# rpm -e kernel-3.10.0-1127.el7.x86_64 (卸载旧版内核)
# rpm -qa | grep kernel* (查看内核版本)
kernel-uek-4.14.35-1902.300.11.el7uek.x86_64
kernel-tools-libs-3.10.0-1127.el7.x86_64
kernel-tools-3.10.0-1127.el7.x86_64
# rpm -e kernel-tools-libs-3.10.0-1127.el7.x86_64 (卸载旧版内核插件包)
error: Failed dependencies: (这边就报错了,因为依赖关系,需要先卸载另一个包,所以还是yum好点)
kernel-tools-libs = 3.10.0-1127.el7 is needed by (installed) kernel-tools-3.10.0-1127.el7.x86_64
libcpupower.so.0()(64bit) is needed by (installed) kernel-tools-3.10.0-1127.el7.x86_64
# rpm -e kernel-tools-3.10.0-1127.el7.x86_64 (卸载旧版内核插件包)
# rpm -e kernel-tools-libs-3.10.0-1127.el7.x86_64 (再次卸载旧版内核插件包,即可)
# rpm -qa | grep kernel* (查看内核版本)
kernel-uek-4.14.35-1902.300.11.el7uek.x86_64 (完毕,现在只有新版在用的内核)
有什么问题欢迎留言,谢谢。