Dealing with Stalled Debian Upgrades

I periodically encounter, when upgrading my Debian systems, situations where the upgrade process stalls. As I recall, this generally happens when upgrading initramfs, but I imagine it can happen with other packages, too.

I apologize in what follows for not showing any listings to help explain what happens and how to resolve it. I forgot to do screen captures! Next time the problem surfaces — and so far, it’s occurred about once in every three or so upgrades — I’ll capture stuff and update this post.

If you do a ps -ax you’ll see that there’s a dpkg action which in turn starts several other processes in turn, with the last one being a process requesting a password, or a confirmation, from the command line…which, since these processes aren’t being run from the command line, can’t be resolved. Hence the stall.

You can sometimes see the recurring prompts for whatever the stalled process is waiting for by attaching strace to either the leaf process (the last child process in the chain) or to the leaf process’ parent process. If you’re lucky, you’ll see what would normally be text being written to a console.

The leaf process’ parent has always been — in my experience, anyway — a systemctl restart of some service. I suspect that what’s happening is some error in certain package post-processing code triggers a systemctl restart in such a way that interaction with a console is required. When you kill the systemctl restart process that releases the overall upgrade process…but it doesn’t do the restart. But since I always restart my entire system after doing upgrades that doesn’t matter.

Leave a Comment

Your email address will not be published. Required fields are marked *

Categories
Archives