Hi, @OldStrummer (Fred)
That scenario doesn't look good When you say that a dpkg update is failing on "update-initramfs: Generating /boot/initrd.img-5.15.0-53-generic
" do you get any error message? In case you do, what is the error message? Or does it simply "hang" there?
Can you check the "apt" log file "/var/log/apt/term.log
" and see if anything that looks relevant / informative appears there?
There's this very recent "Ask Ubuntu" question (posted on 19th November 2022) that may eventually apply to your case, if you see that the situation is actually the same that's happening to you:
In that question, the asker ("John") wrote the following:
"whenever I want to install or uninstall any .deb packages I got this error:
dpkg was interrupted, you must manually run 'sudo dpkg --configure -a'
when I run this command sudo dpkg --configure -a
the /etc/default/grub
sourcing goes into an unbreakable loop
terminal:
Processing triggers for linux-image-5.15.0-53-generic (5.15.0-53.59) ...
/etc/kernel/postinst.d/dkms:
* dkms: running auto installation service for kernel 5.15.0-53-generic
...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.15.0-53-generic
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file
`/etc/default/grub
`
Sourcing file
`/etc/default/grub
`
Sourcing file
`/etc/default/grub
`
(...)"
Another user ("nobody") replied to that question with the following comment that apparently worked for the asker case:
https://askubuntu.com/questions/1441526/endless-looping-of-sourcing-file-etc-default-grub#comment2515314_1441526
mkdir $HOME/backup
and sudo mv /etc/default/grub $HOME/backup
Restore default file with sudo cp /usr/share/grub/default/grub /etc/default/grub
and try your dpkg command again.
– nobody
2 days ago
@OldStrummer: Is that the same case as yours (are you getting an infinite loop of "Sourcing file
`/etc/default/grub
`" when you run "sudo dpkg --configure -a
")? If you are, can you try the above suggestion by "nobody" of making a backup of the current "/etc/default/grub
" file and then overwriting that file with "/usr/share/grub/default/grub
" and then try to run again the "sudo dpkg --configure -a
" and check the result?