Apport Disk Full Error Using apt-get

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,

df -h

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

df -i

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.

One thought on “Apport Disk Full Error Using apt-get”

  1. Thank you, that turned out to be my problem. I had 4gig free in / and 8k inodes which would appear to be too few.
    /dev/sda1 983488 975210 8278 100% /
    After clearing out the oldest directories from /usr/src/ and /lib/modules I have:
    /dev/sda1 983488 244816 738672 25% /

    Updates installed successfully!

Leave a Reply

Your email address will not be published. Required fields are marked *