4

Fresh install (Ubuntu 16.04 LTS) I'm unable to update or install anything via apt. I can run apt update fine but if I follow that with either apt upgrade or apt dist-upgrade it always (I've tried doing so after countless reboots, as well as from recovery mode) results in:

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

If I run that it always does the following and just hangs indefinitely:

Setting up grub-efi-amd64 (2.02~beta2-36ubuntu3.12) ...
Installing for x86_64-efi platform.
Installation finished. No error reported.
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.10.0-35-generic
Found initrd image: /boot/initrd.img-4.10.0-35-generic
Found linux image: /boot/vmlinuz-4.10.0-28-generic
Found initrd image: /boot/initrd.img-4.10.0-28-generic

uname -r shows it's running 4.10.0-35-generic so I'd be fine removing 4.10.0-28-generic since that's where it always hangs but I'm unable to purge it because that just results in apt purge hanging when it gets to Found initrd image: /boot/initrd.img-4.10.0-28-generic.

I've tried every possible ordering of the following without success

sudo dpkg --configure -a
sudo apt install -f
sudo apt clean
sudo apt update
sudo apt upgrade|dist-upgrade|full-upgrade

This is a fresh install so I'm not worried about any "nuclear" options that would result in data loss (i.e. I have no data to lose). I have tried using boot-repair but it never completed (it said it may take a few minutes but I left it running for hours).

I realize the similarities between this question and both E: dpkg was interrupted... run 'sudo dpkg --configure -a' and dpkg --configure -a hangs when found initrd image but none of the answers have helped.

1 Answers1

5

there was an issue with 30_os-prober hanging during grub update. I forget exactly what the issue is.

30_uefi-firmware also has an issue that can be fixed here - https://askubuntu.com/a/938472/694267.

Temporarily remove the execute flag on both can get your config completed.
sudo chmod -x /etc/grub.d/30_os-prober
sudo chmod -x /etc/grub.d/30_uefi-firmware

then run sudo dpkg --configure -a

If you want the system setting entry in grub, repair 30_uefi-firmware then re-enable execute with
sudo chmod +x /etc/grub.d/30_uefi-firmware

then run sudo update-grub

ravery
  • 6,924