Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been having many serious system issues over the past few weeks and have been scratching my head as to why. I've now worked out that this problem is having no inodes left on the root partition

$ df -i
Filesystem      Inodes  IUsed   IFree IUse% Mounted on
/dev/sda6       732960 724565    8395   99% /
udev            125179    518  124661    1% /dev
tmpfs           127001    464  126537    1% /run
none            127001      4  126997    1% /run/lock
none            127001      8  126993    1% /run/shm
/dev/sda7      5234688 144639 5090049    3% /home

What is the cause? I've found that 400K of those are in use in /usr/src

$ ls /usr/src
linux-headers-3.2.0-25-generic      linux-headers-3.2.0-33
linux-headers-3.2.0-25-generic-pae  linux-headers-3.2.0-33-generic
linux-headers-3.2.0-26              linux-headers-3.2.0-33-generic-pae
linux-headers-3.2.0-26-generic      linux-headers-3.2.0-35
linux-headers-3.2.0-26-generic-pae  linux-headers-3.2.0-35-generic
linux-headers-3.2.0-27              linux-headers-3.2.0-35-generic-pae
linux-headers-3.2.0-27-generic      linux-headers-3.2.0-36
linux-headers-3.2.0-27-generic-pae  linux-headers-3.2.0-36-generic
linux-headers-3.2.0-29              linux-headers-3.2.0-36-generic-pae
linux-headers-3.2.0-29-generic      linux-headers-3.2.0-39
linux-headers-3.2.0-29-generic-pae  linux-headers-3.2.0-39-generic
linux-headers-3.2.0-30              linux-headers-3.2.0-39-generic-pae
linux-headers-3.2.0-30-generic      linux-headers-3.2.0-40
linux-headers-3.2.0-30-generic-pae  linux-headers-3.2.0-40-generic
linux-headers-3.2.0-31              linux-headers-3.2.0-40-generic-pae
linux-headers-3.2.0-31-generic      linux-headers-3.2.0-41
linux-headers-3.2.0-31-generic-pae  linux-headers-3.2.0-41-generic
linux-headers-3.2.0-32              linux-headers-3.2.0-41-generic-pae
linux-headers-3.2.0-32-generic      linux-headers-3.2.0-43

Surely not all of these are actually needed? I've tried apt-get autoremove but it leaves them all be. I don't want to remove them manually, but this is crippling my machine. They also take up almost 2G of the 11G system partition that is getting full (>80%) aside from the inode issue.

How can I safely remove the headers that are not needed?

share|improve this question
Have you tried removing the packages that provide those? – Ignacio Vazquez-Abrams May 29 '13 at 11:50… explains how to do it from GUI – hmayag May 29 '13 at 11:53
up vote 12 down vote accepted

You can search for packages that own these files using

dpkg -S /usr/src/*

Check your current kernel version

uname --kernel-release

And remove all old kernel (linux-image-*) and header packages (linux-headers-*) that are not currently used but are still installed.

You can also mark these packages as automatically installed and they should get autoremoved.

share|improve this answer

This should work:

sudo apt-get autoremove

You can read more at the AptGet How-to.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.