OP01-delete_kernel
删除/lib/modules目录下的文件
[root@husa ~]# ls /lib/modules
3.10.0-229.el7.x86_64 3.10.67.1.el7
[root@husa ~]# rm -rf /lib/modules/3.10.67.1.el7
删除/boot目录下的文件
[root@husa ~]# ls /boot/
config-3.10.0-229.el7.x86_64 symvers-3.10.0-229.el7.x86_64.gz
grub System.map
grub2 System.map-3.10.0-229.el7.x86_64
initramfs-0-rescue-f50684c1a00a45f9bd2bdc123ff7d8e3.img System.map-3.10.67.1.el7
initramfs-3.10.0-229.el7.x86_64.img vmlinuz
initramfs-3.10.0-229.el7.x86_64kdump.img vmlinuz-0-rescue-f50684c1a00a45f9bd2bdc123ff7d8e3
initramfs-3.10.67.1.el7.img vmlinuz-3.10.0-229.el7.x86_64
initramfs-3.10.67.1.el7kdump.img vmlinuz-3.10.67.1.el7
initrd-plymouth.img
[root@husa ~]# rm -rf /boot/initramfs-3.10.67.1.el7.img /boot/initramfs-3.10.67.1.el7kdump.img /boot/System.map-3.10.67.1.el7 /bo
ot/vmlinuz-3.10.67.1.el7
删除/lib/src目录下的内核文件
[root@husa ~]# ls /usr/src/
debug kernels linux linux-3.10.67
[root@husa ~]# rm -rf /usr/src/linux /usr/src/linux-3.10.67
更新grub
[root@husa ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-229.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-229.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-f50684c1a00a45f9bd2bdc123ff7d8e3
Found initrd image: /boot/initramfs-0-rescue-f50684c1a00a45f9bd2bdc123ff7d8e3.img
done
重启系统
done