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?

5
  • You can run again, do-release-upgrade to restart the release upgrade. Jun 4, 2012 at 11:31
  • 1
    The answers here did not work for me. I found another one here serverfault.com/questions/387547/… that worked much better. Oct 7, 2012 at 16:32
  • 4
    This worked for me: sudo rm /var/lib/dpkg/lock && sudo dpkg --configure -a (close to what I found in serverfault.com/a/323422/51150 ) Jul 12, 2014 at 4:18
  • 1
    I just had to press Enter again to continue after 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.
    – Ray Foss
    Jun 8, 2019 at 22:38
  • I ended up killing a still-running dpkg and finishing the configuration steps listed here.
    – jozxyqk
    Oct 31, 2022 at 22:24

4 Answers 4

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.

1
  • You may also need to rollback /etc/lsb_release
    – GnP
    Dec 2, 2016 at 15:20
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.

0

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

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

1
  • 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 9, 2015 at 7:03
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .