47

I have read every thread I could find -- even the ones that say that the question has been answered elsewhere but none of them address the specific issue I am having. Update Manager ran and produced errors relating to unmet dependency and suggested using apt-get install -f which fails with this message:

Unpacking linux-headers-3.5.0-36 (from .../linux-headers-3.5.0-36_3.5.0-36.57~precise1_all.deb) ...
dpkg: error processing /var/cache/apt/archives/linux-headers-3.5.0-36_3.5.0-36.57~precise1_all.deb (--unpack):
 unable to create `/usr/src/linux-headers-3.5.0-36/arch/arm/mach-iop32x/include/mach/glantank.h.dpkg-new' (while processing `./usr/src/linux-headers-3.5.0-36/arch/arm/mach-iop32x/include/mach/glantank.h'): No space left on device

I suspect that the last 5 words No space left on device are significant but df and du both show adequate space. So I am wondering, what device needs more space?

Ouput from df -h

Filesystem 
Size Used Avail Use% 
Mounted on /dev/sda1 5.5G 4.4G 786M 86% 
/ udev 996M 4.0K 996M 1% 
/dev tmpfs 402M 880K 401M 1% 
/run none 5.0M 0 5.0M 0% /run/lock none 1004M 156K 1004M 1% 
/run/shm /dev/sdb1 30G 1.4G 27G 5% 
/home /dev/sdc1 299G 31G 268G 11% /media/HD-PCTU2 
Mitch
  • 109,787
Don A
  • 571

5 Answers5

52

I just encountered this same problem. I elsewhere came across a mention of inodes, and ran in my terminal to check inode usage :

  df -i 

This showed inode use at 99%. So, while my disk had plenty of space left, I wasn't able to create more files because of the limit in the number of inodes. Some disk cleanup was the solution to my problem.

Wilf
  • 30,732
Kevin
  • 621
50

I'm thinking your boot partition is full of old kernel images, leaving no room for the new one apt-get is trying to install. You can type

dpkg -l linux-headers-\* linux-image-\* | grep ^ii

into a terminal window. When I do this, I get

ii  linux-headers-3.8.0-18                    3.8.0-18.28                            all          Header files related to Linux kernel version 3.8.0
ii  linux-headers-3.8.0-18-generic            3.8.0-18.28                            amd64        Linux kernel headers for version 3.8.0 on 64 bit x86 SMP
ii  linux-headers-3.8.0-19                    3.8.0-19.30                            all          Header files related to Linux kernel version 3.8.0
ii  linux-headers-3.8.0-19-generic            3.8.0-19.30                            amd64        Linux kernel headers for version 3.8.0 on 64 bit x86 SMP
ii  linux-headers-3.8.0-21                    3.8.0-21.32                            all          Header files related to Linux kernel version 3.8.0
ii  linux-headers-3.8.0-21-generic            3.8.0-21.32                            amd64        Linux kernel headers for version 3.8.0 on 64 bit x86 SMP
ii  linux-headers-3.8.0-22                    3.8.0-22.33                            all          Header files related to Linux kernel version 3.8.0
ii  linux-headers-3.8.0-22-generic            3.8.0-22.33                            amd64        Linux kernel headers for version 3.8.0 on 64 bit x86 SMP
ii  linux-headers-3.8.0-23                    3.8.0-23.34                            all          Header files related to Linux kernel version 3.8.0
ii  linux-headers-3.8.0-23-generic            3.8.0-23.34                            amd64        Linux kernel headers for version 3.8.0 on 64 bit x86 SMP
ii  linux-headers-3.8.0-25                    3.8.0-25.37                            all          Header files related to Linux kernel version 3.8.0
ii  linux-headers-3.8.0-25-generic            3.8.0-25.37                            amd64        Linux kernel headers for version 3.8.0 on 64 bit x86 SMP
ii  linux-headers-generic                     3.8.0.25.43                            amd64        Generic Linux kernel headers

Since I have quite a few, I could delete some of the oldest with

sudo apt-get remove linux-headers-3.8.0-18

If apt-get fails because it misses some package dependencies (which you can't install due to the lack of free inodes), you can resort to dpkg directly instead:

sudo dpkg --remove linux-headers-3.8.0-18

Do that a couple of times to your oldest linux-headers-* and you should have room.

David Foerster
  • 36,890
  • 56
  • 97
  • 151
Marc
  • 10,152
21

I used sudo apt-get autoremove and it removed a bunch of old kernel-headers packages. Good to go after that.

Eliah Kagan
  • 119,640
13

As far as I know the limit of the inodes in Linux ext* file systems is around 4 billion, but not less, which is huge amount of files. So your problem is that something is generating a lot of files. I can propose you to check first this: http://blog.scoutapp.com/articles/2014/10/08/understanding-disk-inodes So you will find what is filling the inodes of your FS. I can propose also to clean the apt cache:

sudo apt-get clean

and

sudo apt-get autoclean
Stefan
  • 399
0

If you ran out of disk space, apt-get clean / apt-get autoclean doesn't give you enough space, and you have some RAM to spare, try my answer at:

https://unix.stackexchange.com/a/726355/250404

I used a ramdisk to squeeze out enough space to complete apt --fix-broken install and recover from this.

karel
  • 122,292
  • 133
  • 301
  • 332
Cedar
  • 101