There is a way to continue the release upgrade after an accidental CTRL + C without killing the dpkg process or restarting the release upgrade again.
Disclaimer: this solution won't work if you killed the screen session too. In that case killing the dpkg process is the way to go.
All you have to know about the do-release-upgrade
- it is running inside screen
- the process starts an additional ssh daemon at port '1022'
The idea is to start a new ssh connection to the machine and use screen to get back to your disconnected session which should be still running.
Steps
ssh user@machine -p 1022 # get back to the machine being upgraded
sudo screen -list # this will list the screen sessions available
You'll be looking for the line starting with somenumber.ubuntu-release-upgrade-screen-window
.
This session may be in Attached or Detached state, it doesn't matter.
sudo screen -d -r root/somenumber.ubuntu-release-upgrade-screen-window #command will get you back to your session and go on from the point where you left it pressing that fatal CTRL + C
At some point during this, suggestions may appear on your console to press this or that key to resume or pause/unpause the upgrade process.
Example
user@machine:~# sudo screen -list
There is a screen on:
1883.ubuntu-release-upgrade-screen-window (11/14/2022 09:45:15 AM) (Attached)
1 Socket in /run/screen/S-root.
user@machine:~# sudo screen -d -r root/1883.ubuntu-release-upgrade-screen-window
sudo rm /var/lib/dpkg/lock && sudo dpkg --configure -a
(close to what I found in serverfault.com/a/323422/51150 )Inhibiting until Ctrl+C
happened. Use system monitor to check if it's actually downloading, you should see a line for hundreds of packages downloading if it's actually working.dpkg
and finishing the configuration steps listed here.