SSH pipe broke while running apt upgrade. What can I do about it

aptaptitudedebianssh

I was connected to my aws debian wheezy server and while running apt-get upgrade the ssh pipe broke. I didn't use screen or anything, so I don't think there's a way to recover that session.

If I reconnect with a new ssh session and run ps aux | grep apt, I can see that apt and dpkg are still running

They've been running for hours actually. I can't imagine that it would be safe to kill those processes as they might be modifying system libs/binaries, but what can I do? What if they are waiting for keyboard input or the like? I had said y when apt originally asked me to install the updates, but I don't know if it needed further user input. I plan on waiting a few more hours for dpkg and apt to hopefully complete what they're doing.. but if nothing happens, what are my options?

Best Answer

I think it is ok to send them a SIGINT (keyboard interruption, i.e. Ctrl+C) signal:

killall -SIGINT apt-get

or

killall -2 apt-get

You may also try to do it twice or more

Related Question