Boot partition full of old kernels

I started getting an error message every time I booted into Ubuntu.  “‘The volume “boot” has only ….. bytes disk space remaining.”.   This is caused by old Linux kernels filling up the boot partition on the hard drive.  For most users, you don’t need to keep old kernels and therefore you can remove them to free up some space.   For simplicity sake – it did this using the Synaptic Package Manager.  Here is how:

1) First, you need to find the current kernel that you are was using – so that you don’t remove it!  Open a terminal and type:

uname -a

Linux toshiba 3.5.0-23-generic #35-Ubuntu SMP Thu Jan 24 13:05:29 UTC 2013 i686 i686 i686 GNU/Linux

2) From the output, I was using 3.5.0-23-generic.  Therefore, I could remove all other kernels with version numbers lower than this.   There are three packages that make up the kernel:

  • linux-header-x-x-x-x-generic
  • linux-image-x-x-x-x-generic
  • linux-image-extra-x-x-x-x-generic

Using Synaptic Package Manager search for linux-header, then linux-image and select  the ones with a lower version number than your current kernel.  Mark each package for removal.  The linux-image-extra will automatically be removed when you remove a linux-image.

Then apply the changes and reboot your machine.

p.s. – it strikes me that it would be really good if Ubuntu could automatically do this.  Perhaps this could be built into the automatic update tool.


2 thoughts to “Boot partition full of old kernels”

  1. Hi, thanks for that 🙂
    Thought it might be useful to add my experience:
    Since I am a noob, I had to install Synaptic (sudo apt-get install synaptic in case you were as inexperienced as I am…). Fortunately, although Synaptic’s own installation at first sight did not complete and returned errors similar to the ones affecting update of the system, it was actually running fine.

  2. Here is what I did to remove the older Kernels, Like the original post I ran “uname -a” to find the kernel I am actively on. then I did a ls of /boot. then I ran this: “sudo apt-get remove linux-image-3.2.0-44-generic” to uninstall the individual kernels so that they do not show up in the list of available kernels upon the next system boot.

Leave a Reply