2

I'm trying to install openvpn however I am running into a problem where Ubuntu is complaining about unmet dependencies:

[sudo] password for keith: 
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-image-extra-4.4.0-71-generic : Depends: linux-image-4.4.0-71-generic but it is not going to be installed
 linux-signed-image-4.4.0-71-generic : Depends: linux-image-4.4.0-71-generic (= 4.4.0-71.92) but it is not going to be installed
 openvpn : Depends: libpkcs11-helper1 (>= 1.11) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

When I try to run apt-get -f install I'm met with these errors:

dpkg: error processing archive /var/cache/apt/archives/linux-image-4.4.0-71-generic_4.4.0-71.92_amd64.deb (--unpack):
cannot copy extracted data for './boot/System.map-4.4.0-71-generic' to '/boot/System.map-4.4.0-71-generic.dpkg-new': failed to write (No space left on device)
No apport report written because the error message indicates a disk full error

If I run df -h I see the below:

Filesystem                    Size  Used Avail Use% Mounted on
udev                          208M     0  208M   0% /dev
tmpfs                          46M  5.2M   41M  12% /run
/dev/mapper/temptus--vg-root  8.3G  6.7G  1.2G  86% /
tmpfs                         228M  4.0K  228M   1% /dev/shm
tmpfs                         5.0M     0  5.0M   0% /run/lock
tmpfs                         228M     0  228M   0% /sys/fs/cgroup
/dev/sda2                     473M  470M     0 100% /boot
/dev/sda1                     511M  3.6M  508M   1% /boot/efi
tmpfs                          46M     0   46M   0% /run/user/1000
/home/keith/.Private          8.3G  6.7G  1.2G  86% /home/Keith

As you can see, /dev/sda2 (/boot) is 100% used. I tried following Can't clean a full /boot because of unmet dependencies, which does free up space in /boot, however when I remove old kernels and finally run apt-get -f install, the space required always increases more than what I cleared.

For example, if I manage to run apt-get -f install before removing kernels it tells me I need 66.4mb of free space. But if I remove a kernel (4.4.31 for example), it increases to 122mb of free space and wants to reinstall whatever kernel I removed.

Is there a way to forcefully remove kernels and have Ubuntu not reinstall after running sudo apt-get -f install?

Thanks!

Zanna
  • 70,465
  • @N0rbert did you read my post? I clearly outlined that I read that post and followed it. It WORKS, but Ubuntu wants to reinstall that kernel after I run apt-get install -f. – Keith Black Mar 29 '18 at 20:00
  • well .. you may have issues .. your boot partition may be too small .. usually Ubuntu will keep 2 kernels .. the latest and the previous to latest so if the latest doesn't work for some reason you have a fall back kernel ... but .. if the two kernels take up too much space when the latest "third" kernel tries to install it fills the drive past what it has ... – John Orion Mar 29 '18 at 20:02
  • 1
    See https://askubuntu.com/a/1001292/66509 . – N0rbert Mar 29 '18 at 20:02
  • ok looked into it more .. you have other issues .. your boot directory has more kernels in it that need to be removed to free space ... I have a boot partition that is only 228M and have the default 2 kernels which are using 107M of the partition so I have basically another 109M space for another kernel to update and for autoremove to remove the oldest. .. you have a 473M partition that is full .. it shouldn't be if you only have the oldest 2 kernels installed. I don't think autoremove is clearing the kernels – John Orion Mar 29 '18 at 20:05
  • since im not a 'command line person" ... open a file manager and look at the boot directory .. see how many initrd.img-x.x.x-xxx-generic items you have .. basically for me ... only two is initrd.img-4.4.0-112-generic and initrd.img-4.4.0-116-generic if you have more than two .. the latest two are the ones you want .. the rest can be removed "properly" (not deleted from the directory in file manager) .. again ... not a command line guy .. I would go to synaptic and find the unwanted kernels and delete the unwanted linux-image-x.x.x-xxx-generic and linux-image-extra-x.x.x-xxx-generic – John Orion Mar 29 '18 at 20:18
  • 1
    just looked at N0rberts post .. yes this is what you want to do .. probably easier than trying to locate the stuff in synaptic :D – John Orion Mar 29 '18 at 20:23
  • Can you try just removing the initrd images using rm? Or mv them to another partition. – Sebastian Stark Mar 30 '18 at 01:15

0 Answers0