-1

I'm getting the following error on sudo apt-get upgrade:

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 linux-headers-generic : Depends: linux-headers-4.4.0-151-generic but it is not installed
 linux-image-generic : Depends: linux-modules-extra-4.4.0-151-generic but it is not installed
                       Recommends: thermald but it is not installed
E: Unmet dependencies. Try using -f.

I then tried sudo apt-get -f install. That gives me another error:

The following additional packages will be installed:
  linux-headers-4.4.0-210 linux-headers-4.4.0-210-generic linux-modules-extra-4.4.0-210-generic
The following NEW packages will be installed:
  linux-headers-4.4.0-210 linux-headers-4.4.0-210-generic linux-modules-extra-4.4.0-210-generic
0 upgraded, 3 newly installed, 0 to remove and 235 not upgraded.
8 not fully installed or removed.
Need to get 47.4 MB of archives.
After this operation, 235 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-modules-extra-4.4.0-210-generic amd64 4.4.0-210.242 [36.6 MB]
Get:2 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-headers-4.4.0-210 all 4.4.0-210.242 [10.0 MB]
Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-headers-4.4.0-210-generic amd64 4.4.0-210.242 [786 kB]
Fetched 47.4 MB in 4s (11.0 MB/s)
(Reading database ... 1423830 files and directories currently installed.)
Preparing to unpack .../linux-modules-extra-4.4.0-210-generic_4.4.0-210.242_amd64.deb ...
Unpacking linux-modules-extra-4.4.0-210-generic (4.4.0-210.242) ...
dpkg: error processing archive /var/cache/apt/archives/linux-modules-extra-4.4.0-210-generic_4.4.0-210.242_amd64.deb (--unpack):
 unable to create '/lib/modules/4.4.0-210-generic/kernel/drivers/media/usb/dvb-usb-v2/dvb-usb-az6007.ko.dpkg-new' (while processing './lib/modules/4.4.0-210-generic/kernel/drivers/media/usb/dvb-usb-v2/dvb-usb-az6007.ko'): 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)

I have read this post. The accepted answer doesn't work b/c sudo apt-get remove linux-image-VERSION gives me the same error as sudo apt-get -f install. I tried the second most upvoted answer and it freed some space:

df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            3.9G     0  3.9G   0% /dev
tmpfs           799M   17M  782M   3% /run
/dev/sda1        22G   19G  2.3G  90% /
tmpfs           3.9G     0  3.9G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
tmpfs           799M     0  799M   0% /run/user/1000

to:

df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            3.9G     0  3.9G   0% /dev
tmpfs           799M   17M  782M   3% /run
/dev/sda1        22G   17G  4.1G  80% /
tmpfs           3.9G     0  3.9G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
tmpfs           799M     0  799M   0% /run/user/1000

After that, I ran sudo apt-get clean, sudo apt-get autoclean and then sudo apt-get -f install as suggested in this answer. But I'm getting the same error. What can I do to resolve this issue?

Update

The output of df -ih is:

Filesystem     Inodes IUsed IFree IUse% Mounted on
udev             993K   411  993K    1% /dev
tmpfs            998K   570  998K    1% /run
/dev/sda1        1.4M  1.4M  1.8K  100% /
tmpfs            998K     1  998K    1% /dev/shm
tmpfs            998K     3  998K    1% /run/lock
tmpfs            998K    16  998K    1% /sys/fs/cgroup
tmpfs            998K     4  998K    1% /run/user/1000
James
  • 101

1 Answers1

2

There are some key clues in your output.

No space left on device can happen for two reasons: Out of space and/or out of inodes.

  • Folks run out of space for the usual reasons: Too many movies and other large files. Occasionally a runaway logfile.
  • Folks run out of inodes when they have too many (thousands) of small files. The classic example is too many kernel header and/or kernel source files.

Your output and troubleshooting seem to have led you to the safe, correct conclusion that inodes are the problem. (Well done!)

  • Look for unused (older) kernel source and kernel header packages. Uninstall them.
  • Some folks install kernel files from non-package sources. Those count against inodes too. If you did so, time to clean them out.

Once your inodes are a bit lower, apt will work again.

user535733
  • 68,493