4

I was upgrading an Ubuntu server (using the do-release-upgrade) command over SSH (I know it's a bad idea, but it was the only choice; I don't have physical access to the server). It seemed to go fine and was going thru the 'setting up package name' part when it froze on the line

Installing new version of config file /etc/mysql/debian-start ...

The SSH connection appears to be still active, as pressing the up arrow echoes back ^[[A, and so on. When I log in on another SSH connection I can log in fine, but the ** system needs restart ** message shows up. Is it safe to ^C the release-upgrade command, or try to reboot the server? Should I ^C the upgrade and try it again? Anything else I could try?

user9517
  • 114,104
  • 20
  • 206
  • 289
Chris
  • 257
  • 4
  • 7
  • General advice; Start the upgrade inside a screen next time. At least that way you can reattach to the session if it's the ssh-connection that messes up. – Kvisle Oct 20 '11 at 19:47
  • 4
    do-release-upgrade already starts itself in a screen session. – Giovanni Toraldo Oct 20 '11 at 20:59
  • 1
    Possible duplicate of [How do I reattach to Ubuntu Server's 'do-release-upgrade' process?](https://serverfault.com/questions/387547/how-do-i-reattach-to-ubuntu-servers-do-release-upgrade-process) – Alex R May 06 '19 at 08:49

3 Answers3

8

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.

Alex R
  • 2,107
  • 2
  • 15
  • 14
7

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 :)

Haider
  • 170
  • 1
  • 4
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?

Mark Henderson
  • 68,316
  • 31
  • 175
  • 255
csgeek
  • 167
  • 7
  • Great thanks! I ctrl-C'd it and did dpkg-configure -a, rebooted and it seems to be ok! my hang was pretty late into the upgrade so it was almost finished, so I guess you'd have more bugs, or totally kill the system, if it happened earlier. From what I saw after ctrl-C, the actual do-release-upgrade hung, not the ssh session. Anyway thanks for the help! Lifesaver! – Chris Oct 21 '11 at 20:21