I'm tring to run

sudo apt-get -f install


Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-53 linux-headers-4.4.0-53-generic linux-headers-4.4.0-57 linux-headers-4.4.0-57-generic linux-headers-4.4.0-59 linux-headers-4.4.0-59-generic linux-headers-4.4.0-62 linux-headers-4.4.0-62-generic
  linux-headers-4.4.0-63 linux-headers-4.4.0-63-generic linux-headers-4.4.0-64 linux-headers-4.4.0-64-generic linux-headers-4.4.0-66 linux-headers-4.4.0-66-generic linux-headers-4.4.0-70 linux-headers-4.4.0-70-generic
  linux-headers-4.4.0-71 linux-headers-4.4.0-71-generic linux-headers-4.4.0-72 linux-headers-4.4.0-72-generic linux-headers-4.4.0-75 linux-headers-4.4.0-75-generic linux-headers-4.4.0-78 linux-headers-4.4.0-78-generic
  linux-headers-4.4.0-79 linux-headers-4.4.0-79-generic linux-headers-4.4.0-81 linux-headers-4.4.0-81-generic linux-headers-4.4.0-83 linux-headers-4.4.0-83-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 85 not upgraded.
6 not fully installed or removed.
Need to get 9,919 kB of archives.
After this operation, 70.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://eu-central-1.ec2.archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-headers-4.4.0-89 all 4.4.0-89.112 [9,919 kB]
Fetched 9,919 kB in 0s (23.4 MB/s)
(Reading database ... 467324 files and directories currently installed.)
Preparing to unpack .../linux-headers-4.4.0-89_4.4.0-89.112_all.deb ...
Unpacking linux-headers-4.4.0-89 (4.4.0-89.112) ...
dpkg: error processing archive /var/cache/apt/archives/linux-headers-4.4.0-89_4.4.0-89.112_all.deb (--unpack):
 unable to create '/usr/src/linux-headers-4.4.0-89/arch/frv/include/asm/switch_to.h.dpkg-new' (while processing './usr/src/linux-headers-4.4.0-89/arch/frv/include/asm/switch_to.h'): No space left on device
No apport report written because the error message indicates a disk full error
                                                                              dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

The output of dpkg -l | grep linux-image is:

ii  linux-image-4.4.0-87-generic     4.4.0-87.110                               amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
iF  linux-image-4.4.0-89-generic     4.4.0-89.112                               amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
iU  linux-image-virtual                                    amd64        This package will always depend on the latest minimal generic kernel image.

It seems as if Im currently using version .87 with version .89 half way configured (Status iF)


hard disk space is not the issue, output of df -h is:

Filesystem      Size  Used Avail Use% Mounted on
/dev/root       7.8G  4.9G  2.5G  67% /
devtmpfs        494M     0  494M   0% /dev
tmpfs           496M  4.0K  496M   1% /dev/shm
tmpfs           496M  6.9M  489M   2% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           496M     0  496M   0% /sys/fs/cgroup
tmpfs           100M     0  100M   0% /run/user/1001
/dev/xvdf       7.8G  153M  7.2G   3% /database
  • 1
    You can use the command: du -csh /* to check the disk space in subfolders and see exactly where you need to delete. You might have loads of logs taking space. To remove old kernels you can simply run: apt-get autoremove --purge
    – Adonist
    Aug 9 '17 at 14:41
  • You have few choices other than freeing up some disk space as mentioned by @Adonist . Two command that I have found helpful are df -h to determine which disk system is overfull, and sudo du -aBM -d 1 . | sort -nr | head -20 to determine which subdirectories of the current directory are the largest in terms of disk usage Aug 9 '17 at 15:52
  • edited the question with the output of df -h, harddisk space doesnt seem to be the issue
    – johan855
    Aug 9 '17 at 15:54
  • 3
    @johan855 have you check inode status ? share the output of this command df -i Sep 15 '17 at 5:16
  • 1
    yes, inodes where completely full, I had to manually remove some of the old packages by specifically writing the names one by one until I had freed around 2-3% more.
    – johan855
    Sep 15 '17 at 7:51

I can't say what causes the error to come back as disk space but I did run into exactly this issue tonight and I solved it by manually removing some of the old headers and then continuing on normally.

sudo rm -rf /usr/src/linux-headers-4.4.0-5*
sudo rm -rf /usr/src/linux-headers-4.4.0-6*

After this I was able to use apt for everything else like normal.

  • 1
    Yes, did the same thing and worked for me as well.
    – johan855
    Sep 15 '17 at 7:51
  • It would make more sense if /usr/ was on a separate partition but in my case it's just all on one in /. Weird stuff.
    – Nathan V
    Oct 4 '17 at 2:59

Most likely there is still space left on the device, but not enough inodes.

Confirm this by running

df -hi

# example output
Filesystem     Inodes IUsed IFree IUse% Mounted on
udev             596K   575  596K    1% /dev
tmpfs            604K   963  604K    1% /run
/dev/sda1         29M  2,8M   26M   10% /
tmpfs            604K    62  604K    1% /dev/shm
tmpfs            604K     7  604K    1% /run/lock
tmpfs            604K    18  604K    1% /sys/fs/cgroup
tmpfs            604K    38  604K    1% /run/user/1000

What are inodes?

Tthink of a book where you can only read chapters that are listed in the table of contents. Each table of contents entry is an inode (refers to a file or directory). But there is a fixed number of pages reserved to the table of contents, say three pages, equalling 200 chapters. Now, if every chapter is really short, you will have empty blank pages at the end of the book that cannot be written.

What happened?

You seem to have many small files or empty directories. Most likely many linux-headers-* packages are install, which come with ~20k source code files. Look for these packages and delete them. Or delete other content with many small files.

Oups after typing this I saw that inodes were mentioned in the original posts comments. Might be helpful as an answer nonetheless

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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