虚拟机boot空间不足解决办法
在更新centos内核版本时提示/boot目录至少需要37M空间,即/boot空间不足
Transaction check error:
installing package kernel-ml-6.2.2-1.el7.elrepo.x86_64 needs 37MB on the /boot filesystem
Error Summary
-------------
Disk Requirements:
At least 37MB more space needed on the /boot filesystem.
解决办法:
1.查看/boot下还有多少可用空间
[root@localhost ~]# df -H /boot Filesystem Size Used Avail Use% Mounted on /dev/sda1 312M 309M 2.2M 100% /boot
显示只剩下2.2M可用空间
2.先看看所有的内核包:
[root@localhost ~]# rpm -qa|grep kernel kernel-devel-3.10.0-1160.83.1.el7.x86_64 kernel-3.10.0-1160.83.1.el7.x86_64 kernel-devel-3.10.0-1160.el7.x86_64 kernel-3.10.0-1160.81.1.el7.x86_64 kernel-headers-3.10.0-1160.83.1.el7.x86_64 kernel-ml-6.1.6-1.el7.elrepo.x86_64 abrt-addon-kerneloops-2.1.11-60.el7.centos.x86_64 kernel-tools-libs-3.10.0-1160.83.1.el7.x86_64 kernel-tools-3.10.0-1160.83.1.el7.x86_64 kernel-3.10.0-862.el7.x86_64 kernel-devel-3.10.0-1160.81.1.el7.x86_64
3.查看当前系统使用的是哪个
[root@localhost ~]# uname -a Linux localhost.localdomain 3.10.0-1160.83.1.el7.x86_64 #1 SMP Wed Jan 25 16:41:43 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
4.可以删除当前使用内核版本外的其它内核包
[root@localhost ~]# sudo rpm -e kernel-3.10.0-862.el7.x86_64 kernel-3.10.0-1160.81.1.el7.x86_64
5.删除后再查看/boot下的空间
[root@localhost ~]# df -H /boot Filesystem Size Used Avail Use% Mounted on /dev/sda1 312M 229M 83M 74% /boot
现在已经有83M空间了,超过了37M,接下来就可以继续安装了