How to free up space on /boot partition (Linux)

On Centos:

1. Check the current kernel that is in use - uname -a
2. Run ls /boot to see the kernels currently stored on /boot.
3. Run package-cleanup --old-kernels --count=2 (this will keep only 2 kernels and remove the rest)
4. You can also edit /etc/yum.conf and set installonly_limit=2.This will ensure that the max no. of kernels at any time is 2. 

On Ubuntu:

1. Check the current kernel that is in use - uname -a
2. Run ls /boot to see the kernels currently stored on /boot.
3. Run sudo apt-get remove linux-image-d.b.c-{x,x,x}-server. This removes all old kernel versions. Check to see that the current kernel version is not included. Note: d, b, c refer to version numbers and x to the actual kernel version.
4. You can then remove any dependencies left by running sudo apt-get autoremove

Was this answer helpful?

 Print this Article

Also Read

Create a new user (Linux)

Please note that user refers to the username of the user you wish to create. Create a user -...

Extending root filesystem using LVM (Linux)

Step 1: Confirm Disk Partitions in Distribution. You can do this by typing   df –h Step 2:...

Generating SSH Keys - Mac OS and Linux

Public key authentication provides additional security as compared to password authentication....

Allow ssh password login (Linux)

Open the file /etc/ssh/sshd_config and change the line PasswordAuthentication no to...