0

I am trying to run some updates on my server but everything fails because apt keeps throwing the error "Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution)."

If I run that command I get a long list off errors.

Running df -h gives me the following (I'm assuming the problem is because my boot partition is full):

Filesystem             Size  Used Avail Use% Mounted on
tmpfs                  389M  1.8M  388M   1% /run
/dev/mapper/vg00-lv01   77G   26G   48G  36% /
tmpfs                  1.9G  4.0K  1.9G   1% /dev/shm
tmpfs                  5.0M   24K  5.0M   1% /run/lock
/dev/sdb1               40G   17G   21G  46% /mnt/block
/dev/sda1              488M  475M     0 100% /boot
tmpfs                  389M  8.0K  389M   1% /run/user/0

I have tried these questions, and the answers just result in the same error "Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution)."

/dev/sda1 disk full - 100% usage

/dev/sda1 /boot is full

How do I free up more space in /boot?

All three pretty much lead back to the "sudo apt-get purge" command, and anything "apt" gives me the same error.

When attempting to run the following (recommended on the ubuntu help site)

sudo dpkg --purge linux-image-5.15.0-58-generic linux-image-extra-5.15.0-58-generic

I get

dpkg: error processing package linux-image-5.15.0-58-generic (--purge):
dependency problems - not removing

this is not a duplicate, the answers in the referenced questions do not work in this case.

  • one of those answers in the ones you posted has a step to manually remove one old kernel using rm so that you can continue with the apt purge. – rtaft Dec 18 '23 at 18:43
  • I saw that and wasn't sure of the consequences because a comment on the other question explicitly said not too. It is a vm and I took a snapshot so I might as well go for it.

    I did move a couple of the files to the main partition to temporarily clean space, and then ran the apt autoremove command and it just immediately filled the boot partition back up.

    – Developer Gee Dec 18 '23 at 19:01
  • you might be able to replace the file with a 0 byte file, so the package manager doesn't error on it when it tries to remove it. I used to dump these files by hand all the time, can't remember if there were repercussions but I always got around them eventually (also in a VM). – rtaft Dec 18 '23 at 20:42
  • 1
    One option that might be faster and simpler: Back up your data. Partition and clean-install a new VM, making your /boot larger. Restore your data onto the new system. – user535733 Dec 18 '23 at 21:08
  • @DeveloperGee if you have filled up a ~500 MB partition, remove a lot more than "a couple of files". Maybe leave only a couple of kernels alone and delete the rest as your update will be adding a third anyway. – muru Dec 19 '23 at 00:12
  • I deleted everything out of there except for the kernel is running (giving me 71% free space) and when I run the "apt --fix-broken install" it just immediately fills the partition back up. I am apparently several kernels behind so I'm guessing that adds to the problem. – Developer Gee Dec 19 '23 at 22:05
  • @DeveloperGee Ubuntu doesn't try to install every kernel version, though, so that doesn't matter. Post the full output of apt --fix-broken install please – muru Dec 20 '23 at 00:54
  • I don't now if each time I ran that command it got 1 step closer, but this morning I deleted all of the extra file again, and then ran that command again and it completed without errors this time. I don't know what the actual fix was but I appreciate everyones help. – Developer Gee Dec 20 '23 at 15:46

0 Answers0