So, I was performing an Ubuntu Server upgrade from 11.04 to 11.10.

I forgot about it in the background, and my SSH client timed out and disconnected (putty on Windows, go figure). The last thing on my terminal was a question about keeping an old config, etc.

When I logged back in to the server, aptitude files were locked by another process, so I assume this upgrade process is sat there waiting for my input.

How I can interact with this process and continue the upgrade? If possible.

Thanks

link|improve this question
possible duplicate of Reconnect ssh session when disconnected without screen – quanta Oct 14 '11 at 15:53
feedback

3 Answers

cryopid (found via this question) might help unless the current "one process, not a tree of processes" is a problem in this instance.

The files may be locked because the process was unceremoniously killed and didn't get chance to clean up after itself, so confirm that aptitude is actually still running. Use lsof /var/lib/dpkg/lock as suggested in Teddy's answer to check - this will tell you the pid to try cryopid on too.

In future I recommend to try running through screen where-ever possible. I have made a habit of screen (or byobu, which is a wrapper around screen that defines some useful behaviours) being the first thing I run when SSHing to anywhere then I can reconnect if there are issues. You can set it up to start or reattach automatically, though I've never got around to doing that anywhere - there are a number of examples online (this one for instance) if you want to try that.

link|improve this answer
feedback

You can't. Find the upgrade process by doing

lsof /var/lib/dpkg/lock

Kill it, fix any interrupted upgrades with

dpkg --configure --pending

and restart the upgrade.

link|improve this answer
Is this safe with the process being a do-release-upgrade? – Stephen Melrose Oct 14 '11 at 16:02
feedback

The process actually runs in a screen or byobu session as the root user. reconnect to the server with putty on port 22 or the failsafe 1022. sudo su - or su - into your root account and resume the screen with byobu or a screen -r and resume where you left.

oh and yes i found out the hard way ;-)

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.