If you’re a Ubuntu user who finds themselves with an ugly message like this one day when running a apt-get update,
No apport report written because the error message indicates a disk full error
you may have thought you’ve run out of disk space and run the command,
but then found you had plenty of space free. Well maybe you do have plenty of bytes free but what about inodes? They’re effectively a limitation of the number of files you can have in a filesystem. So try using
and perhaps like me you’ll find there are very few inodes left. So you need to do some digging to find a ton of files to delete by running this command starting from / and following the largest volume of files.
sudo find . -xdev -type f | cut -d "/" -f 2 | sort | uniq -c | sort -n
In my case the packages that were being affected during the upgrade were the kernel images. But I couldn’t remove any of them or repair the package using the -f option for apt-get as the inodes were so reduced the kernel couldn’t unpack and install properly.
So, somewhat ironically, the find command above lead me to the /usr/src directory which holds copies of old kernel-image installers. I removed a few of the old ones in that dir (use uname -r to get your current kernel version) and freed up almost 100k inodes. Straight away the same apt-get upgrade worked just fine and let me do some further clean up.
From some quick Googling it seems deleting files is the only way to resolve the issue of increasing available inodes – or recreate the filesystem. For most people the latter will be a distant second option.