18

I did a do-release-upgrade. During the process I was asked if I wanted to replace my rsync config file in init.d with the new version or keep the existing one. I hit D to look at the diff and then could not get back to the question / install script. I stupidly hit ctrl c and was not returned to the upgrade process but to the shell.

I am now worried I have a broken install :( What should I do?

Bruno Pereira
  • 73,643
Amir
  • 591

4 Answers4

12

Your /etc/apt/sources.list was most probably changed to the new version at the point you aborted the upgrade. This will make do-release-upgrade or apt-get dist-upgrade behavior unpredictable.

  • Change it first with (assuming you were upgrading from 11.10):

    sudo sed -i -e 's/precise/oneiric/g' /etc/apt/sources.list

  • Then do a sudo apt-get update followed by a do-release-upgrade.

ish
  • 139,926
2

There is a better way than replacing the dist name in source.list with sed as mentioned in another answer. The upgrader creates a /etc/apt/sources.list.distUpgrade backup file, you just have to rename it to /etc/apt/sources.list to restore your original sources.list, apt update and then restart do-release-upgrade.

Eugene
  • 1,566
  • 2
  • 11
  • 10
0

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

  1. it is running inside screen
  2. 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

  1. ssh user@machine -p 1022 # get back to the machine being upgraded
  2. 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.

  1. 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
linux64kb
  • 1,119
0

You can run again do-release-upgrade to restart the release upgrade.

The release upgrade, will start from the beginning, again.

  • Depending on how far you made it through the upgrade process, this may not work, and you'll have to edit sources.list – Jordan Apr 09 '15 at 07:03