On 16.04, after trying the Ubuntu updater last night, it got hung up (on initramfs if I remember the details dialog correctly). After a long time I killed it and looked for solutions, of which I tried (I hope I remember all):
sudo dpkg --configure -a
$ sudo apt-get --purge remove linux-image-4.4.0-112-generic linux-image-extra-4.4.0-112-generic E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
$ sudo dpkg --purge remove linux-image-4.4.0-112-generic linux-image-extra-4.4.0-112-generic dpkg: warning: ignoring request to remove remove which isn't installed dpkg: warning: ignoring request to remove linux-image-4.4.0-112-generic which isn't installed (Reading database... 756101 files and directories currently installed.) Removing linux-image-extra-4.4.0-112-generic (4.4.0-112.135) ... depmod: FATAL: could not load /boot/System.map-4.4.0-112-generic: No such file or directory run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-112-generic /boot/vmlinuz-4.4.0-112-generic run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-112-generic /boot/vmlinuz-4.4.0-112-generic run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-112-generic /boot/vmlinuz-4.4.0-112-generic update-initramfs: Generating /boot/initrd.img-4.4.0-112-generic depmod: WARNING: could not open /var/tmp/mkinitramfs_2OAOqm/lib/modules/4.4.0-112-generic/modules.order: No such file or directory depmod: WARNING: could not open /var/tmp/mkinitramfs_2OAOqm/lib/modules/4.4.0-112-generic/modules.builtin: No such file or directory
$ uname -a Linux tnt440s 4.4.0-109-generic #132-Ubuntu SMP Tue Jan 9 19:52:39 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
I also did, found somewhere on the interwebs:
sudo rm /var/lib/initramfs-tools/4.4.0-112-generic
I am now scared of a reboot as I have had broken kernels before (but it seems I am now still on kernel 4.4.0-109, and am looking for a way to fix the incompletely installed new kernel and get
apt-upgrade to work again.
I was able to remove all but the
Trying to force install it (
apt-get install -f) sent me to manually run
dpkg --configure -a), but that again hung as above.
So as found here on Ubuntu Forums, I deleted the files in
which then allowed me to force install the package again - but it brings me to the original error: hanging on
Selecting previously unselected package linux-image-4.4.0-112-generic. (Reading database ... 756103 files and directories currently installed.) Preparing to unpack .../linux-image-4.4.0-112-generic_4.4.0-112.135_amd64.deb ... Done. Unpacking linux-image-4.4.0-112-generic (4.4.0-112.135) ... Setting up linux-firmware (1.157.15) ... update-initramfs: Generating /boot/initrd.img-4.4.0-112-generic