2

i'm stuck in a chain of errors.

Since a long time I regularly get the error that I dont have enough free disk space in boot. (I always managed to resolve the problem but not this time)

My current kernel version is

4.4.0-101-generic

I tried to remove other kernels using

sudo apt-get purge image-extra-4.4.0-xxx-generic

and get the error

The following packages have unmet dependencies:
 linux-image-extra-4.4.0-103-generic : Depends: linux-image-4.4.0-103-generic but it is not going to be installed
 linux-image-extra-4.4.0-121-generic : Depends: linux-image-4.4.0-121-generic but it is not going to be installed
 linux-image-generic-lts-xenial : Depends: linux-image-4.4.0-121-generic but it is not going to be installed

Now I'm stuck with this error and I can't find any other questions with a similar error.

What should I do?

My long term goal is to upgrade from Ubuntu 14.04. to 16.06, but I feel like I have to resolve that issue first. Also,is there a way to completely resolve this problem? (Since it happened to me every 2 months or so.)

Update: Thanks for the quick answers so far! Here is the output-->

ll /boot
total 231964
drwxr-xr-x  5 root root     4096 Apr 24 23:17 ./
drwxr-xr-x 23 root root     4096 Nov 30 17:01 ../
-rw-r--r--  1 root root  1249214 Nov 10 21:39 abi-4.4.0-101-generic
-rw-r--r--  1 root root  1246835 Aug  2  2017 abi-4.4.0-89-generic
-rw-r--r--  1 root root  1247269 Aug 14  2017 abi-4.4.0-93-generic
-rw-r--r--  1 root root  1249161 Sep 13  2017 abi-4.4.0-96-generic
-rw-r--r--  1 root root  1249112 Sep 20  2017 abi-4.4.0-97-generic
-rw-r--r--  1 root root  1249237 Okt 11  2017 abi-4.4.0-98-generic
-rw-r--r--  1 root root   190497 Nov 10 21:39 config-4.4.0-101-generic
-rw-r--r--  1 root root   190364 Aug  2  2017 config-4.4.0-89-generic
-rw-r--r--  1 root root   190364 Aug 14  2017 config-4.4.0-93-generic
-rw-r--r--  1 root root   190525 Sep 13  2017 config-4.4.0-96-generic
-rw-r--r--  1 root root   190525 Sep 20  2017 config-4.4.0-97-generic
-rw-r--r--  1 root root   190525 Okt 11  2017 config-4.4.0-98-generic
drwxr-xr-x  3 root root     4096 Jan  1  1970 efi/
drwxr-xr-x  5 root root     1024 Nov 30 17:02 grub/
-rw-r--r--  1 root root 23170072 Dez  6 14:55 initrd.img-4.4.0-101-generic
-rw-r--r--  1 root root 23074243 Dez  6 14:56 initrd.img-4.4.0-57-generic
-rw-r--r--  1 root root 23091471 Dez  6 14:55 initrd.img-4.4.0-89-generic
-rw-r--r--  1 root root 23090990 Dez  6 14:55 initrd.img-4.4.0-93-generic
-rw-r--r--  1 root root 23171154 Dez  6 14:55 initrd.img-4.4.0-96-generic
-rw-r--r--  1 root root 23170886 Dez  6 14:55 initrd.img-4.4.0-97-generic
-rw-r--r--  1 root root 23170889 Dez  6 14:55 initrd.img-4.4.0-98-generic
drwx------  2 root root    12288 Jan 25  2016 lost+found/
-rw-r--r--  1 root root   176500 Mär 12  2014 memtest86+.bin
-rw-r--r--  1 root root   178176 Mär 12  2014 memtest86+.elf
-rw-r--r--  1 root root   178680 Mär 12  2014 memtest86+_multiboot.bin
-rw-------  1 root root  3900892 Nov 10 21:39 System.map-4.4.0-101-generic
-rw-------  1 root root  3898002 Aug  2  2017 System.map-4.4.0-89-generic
-rw-------  1 root root  3899015 Aug 14  2017 System.map-4.4.0-93-generic
-rw-------  1 root root  3899973 Sep 13  2017 System.map-4.4.0-96-generic
-rw-------  1 root root  3899943 Sep 20  2017 System.map-4.4.0-97-generic
-rw-------  1 root root  3900749 Okt 11  2017 System.map-4.4.0-98-generic
-rw-------  1 root root  7006432 Nov 10 21:39 vmlinuz-4.4.0-101-generic
-rw-------  1 root root  7000368 Aug  2  2017 vmlinuz-4.4.0-89-generic
-rw-------  1 root root  7000752 Aug 14  2017 vmlinuz-4.4.0-93-generic
-rw-------  1 root root  7003248 Sep 13  2017 vmlinuz-4.4.0-96-generic
-rw-------  1 root root  7005136 Sep 20  2017 vmlinuz-4.4.0-97-generic
-rw-------  1 root root  7006544 Okt 11  2017 vmlinuz-4.4.0-98-generic

I followed the instructions in this Question My /boot partition hit 100% and now I can't upgrade. Can't remove old kernels to make room and managed to make room on boot (about 70%), but after I hit sudo apt-get update my terminal installed every image back and ran out of space before it could complete the installation of the critical images 103 and 121, which have the unmet dependencies.

In addition, I tried to unmount my /boot partition and followed these Instructions How do I merge my /boot partition to be a part of the / partition? I came so far as to comment out the part where the mount point of boot is defined. (I had to unmount a busy /boot though using umount -l) But when I hit sudo grub-install I got the error

Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.
1
  • run ll /boot in your terminal and copy the output into your question. Apr 25 '18 at 2:04
0

I had a similar problem on Ubuntu 16.04.4 LTS and it was caused by insufficient disk space on /boot (No space left on device). I was able to resolve the problem with the following command to remove and purge the old kernels installed while keeping the current kernel:

sudo apt-get remove --purge $(dpkg -l 'linux-image-*' | sed '/^ii/!d;/'"$(uname -r| sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d')

This may not be a safe solution because it will keep the current kernel only while removing all other kernels. Hope this helps!

0

The simplest solution to your problem is to get rid of the separate /boot partition and make it a sub-directory under / instead. There is no "official" answer on how to do this in Ask Ubuntu that I found but this Q&A answered by Rod Smith comes the closest: How do I merge my /boot partition to be a part of the / partition?

Looking at your ll /boot output there are three kernels to quickly remove to get back space:

sudo rm -f /boot/*4.4.0-96*
sudo rm -f /boot/*4.4.0-97*
sudo rm -f /boot/*4.4.0-98*

Then you can fully remove them following these instructions (substituting x for valid number):

sudo apt-get purge linux-image-x.x.x-x-generic

Now you should have enough space to install at least one new kernel, probably two.

After you get one or two new working kernels installed, you can use remove kernels -83 and -89 as well. From then on use:

sudo apt-get autoremove

and it will remove all kernels except the two latest versions.

2
  • i've added the output and also updated, what I tried in the meantime
    – Arkantos
    Apr 25 '18 at 9:01
  • @Arkantos I've updated instructions to get you going. Haven't found the answer to the grub-install problem under EFI yet though. You might want to post a comment under the answer in that thread. Ask if the OP can update answer for your error message. Apr 25 '18 at 10:19

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