How to fix: At least xMB more space needed on the /boot filesystem
原帖地址: https://haydenjames.io/fix-least-xmb-space-needed-boot-filesystem/
List all installed kernel packages with:
yum list kernel
The kernel in-use will be underlined and cannot be removed:
yum list kernel
Now to remove unused kernels, install the yum-utils package and use the package-cleanup util:
yum install yum-utils
package-cleanup --oldkernels --count=2
To make this permanent, edit /etc/yum.conf and add the following line:
installonly_limit=2
– – – – – – – – – – – – – – – – – – – – — – – – – – – – – – – – – – – – – – – – — – – – – – – – – – – – – – – – – – – – –
Original article:
While updating a client’s CentOS 6 server using “yum update” I ran into the following error:
Transaction Check Error: installing package kernel-2.6.32-358.2.1.el6.x86_64 needs 11MB on the /boot filesystem
Error Summary
Disk Requirements: At least 11MB more space needed on the /boot filesystem.
To check the free space on /boot I ran the following command: df -h
Which gave the following output:
Filesystem Size Used Avail Use% Mounted on
/dev/vda3 136G 60G 70G 46% /
tmpfs 5.3G 0 5.3G 0% /dev/shm
/dev/vda1 99M 77M 17M 82% /boot
/usr/tmpDSK 1.3G 35M 1.2G 3% /tmp
As you can see the boot partition is 82% full.
To list installed kernels use this command:
rpm -qa | grep kernel
The result:
kernel-2.6.32-220.7.1.el6.x86_64
kernel-headers-2.6.32-358.2.1.el6.x86_64
dracut-kernel-004-303.el6.noarch
kernel-2.6.32-279.19.1.el6.x86_64
kernel-firmware-2.6.32-358.2.1.el6.noarch
kernel-2.6.32-279.9.1.el6.x86_64
So to remove the oldest kernel, I ran:
rpm -e kernel-2.6.32-220.7.1.el6.x86_64
Then: df -h
Output:
Filesystem Size Used Avail Use% Mounted on
/dev/vda3 136G 60G 70G 46% /
tmpfs 5.3G 0 5.3G 0% /dev/shm
/dev/vda1 99M 52M 42M 56% /boot
/usr/tmpDSK 1.3G 35M 1.2G 3% /tmp
As you can see that freed up more than the 11MB needed. So I retried yum -y update kernel and this time it works. Finally I deleted the old ones again:
rpm -e kernel-2.6.32-279.9.1.el6.x86_64 kernel-2.6.32-279.19.1.el6.x86_64
Final result, 70M free!.
/dev/vda1 99M 25M 70M 26% /boot