Ubuntu Server upgrade over SSH hang

Solution 1:

I usually do release upgrades over VPN, so I've tried this a few times. Whenever it updates my openvpn package I lose connection, so I reconnect afterwards.

do-release-upgrade starts a backup SSH session on port 1022 and a backup screen session. If you do not have screen installed this will NOT be available.

You can get the screen session by running:

sudo screen -list
There is a screen on:
    2953.ubuntu-release-upgrade-screen-window   (09/13/2012 04:48:02 AM)    (Detached)
1 Socket in /var/run/screen/S-root.

Then to reattach do:

sudo screen -d -r root/2953.ubuntu-release-upgrade-screen-window

Using the previously listed screen after root/

You should be back to where you lost connection.

Solution 2:

I got nervous when this happened to me today. It froze for about 15 minutes.

Trying to solve this, I got a second SSH connection running, found mysql PIDs via ps aux | grep mysql and killed them. It didn't seem to help, so I used service mysql stop - thankfully it worked and after a few seconds do-release-upgrade did its remaining job.

That was close. No more upgrades for tonight :)

Solution 3:

I'm having the exact same problem.

I'm not sure if it's a fix, or the right way of going about it....

but I Ctrl+C the process, then.

sudo rm /var/lib/dpkg/lock sudo dpkg --configure -a (you'll probably get some errors) sudo apt-get remove mysql-server # we can fix this later. I'm mainly concerned with getting the OS to boot properly

Once that was complete, I ran apt-get dist-upgrade

I think I'll end up having to do the dpkg --configure -a and dist-upgrade several times before all the bugs get ironed out.

Not perfect, and messy.. but a suggestion?