Do_release_upgrade seems to have hung in the middle. Now what should I do

I ran sudo_do_release_upgrade trying to upgrade from 22.04.5 LTS to 24.04 LTS. Guess I’m a glutton for punishment. It hung in the middle, stuck on this screenshot.

It hasn’t moved for 20 minutes.

It’s not low on disk space. df says only 13% used.

The 22.04 system is still functioning but will it survive a reboot? Where is all the stuff it downloaded? Has it overwritten the old stuff?

What do I do now?

At this point, I already see this:

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu 24.04.2 LTS"

stevecoh1 - Hey

I take it that you have returned to prompt from the upgrade -

what now results:

sudo apt update
sudo apt upgrade

-Oh what tales to be told-

No. I am still on the previous system.

The shell with the do-release-upgrade is still in the same place it was before. See above.

/etc/lsb-release SAYS I’m running 24.04.2 but the process isn’t finished setting things up.

I haven’t “returned to prompt”. I just opened another terminal.

What should I do now. I have a backup but restoring the previous system will be a two-day process. Aaargh!

What is my best move in this situation?

Scary times - this

As the system is not progressing on its own - given plenty of time now, me thinks it is time to take maters in hand,

Were me I would terminate the upgrade process and hope hope to figure out what it will take to move forward.
Here the package manager’s advise will aid.
Show us

sudo apt --fix-broken install

we see what the package manager has to say.

-where we go from here-

These processes are still running. What does that tell me?

$ ps -ef | grep upgrade
root        1006       1  0 11:28 ?        00:00:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
root      357514  351662  0 16:08 pts/0    00:00:01 sudo do-release-upgrade
root      357517  357514  0 16:08 pts/1    00:00:00 sudo do-release-upgrade
root      357518  357517  0 16:08 pts/1    00:00:25 /usr/bin/python3 -s /tmp/ubuntu-release-upgrader-nxd4u5wu/noble --mode=server --frontend=DistUpgradeViewText
root      376054  357518  0 16:18 pts/1    00:00:03 /usr/bin/python3 -s /tmp/ubuntu-release-upgrader-nxd4u5wu/noble --mode=server --frontend=DistUpgradeViewText
root      461258  357518  0 16:27 pts/1    00:00:00 python3 /usr/lib/ubuntu-advantage/upgrade_lts_contract.py
scohen    550206  479113  0 17:33 pts/3    00:00:00 grep --color=auto upgrade

okay, killed it.

$ sudo apt --fix-broken install
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock. It is held by process 420617 (dpkg)  

Guess I should kill process 420617?

In case it’s of any use, here is the output of the “traceback” after I killed the upgrade process.

Traceback (most recent call last):
                                    File "/usr/lib/ubuntu-advantage/upgrade_lts_contract.py", line 19, in <module>
             upgrade_lts_contract.process_contract_delta_after_apt_lock(cfg)
                                                                              File "/usr/lib/python3/dist-packages/uaclient/upgrade_lts_contract.py", line 86, in process_contract_delta_after_apt_lock
                                                                                                  time.sleep(10)
       KeyboardInterrupt

                        Traceback (most recent call last):
                                                            File "/tmp/ubuntu-release-upgrader-nxd4u5wu/noble", line 8, in <module>
                              sys.exit(main())
                                                File "/tmp/ubuntu-release-upgrader-nxd4u5wu/DistUpgrade/DistUpgradeMain.py", line 241, in main
                                         if app.run():
                                                        File "/tmp/ubuntu-release-upgrader-nxd4u5wu/DistUpgrade/DistUpgradeController.py", line 2662, in run
                                                       return self.fullUpgrade()
                                                                                  File "/tmp/ubuntu-release-upgrader-nxd4u5wu/DistUpgrade/DistUpgradeController.py", line 2628, in fullUpgrade
                                                                                         self.runPostInstallScripts()
              File "/tmp/ubuntu-release-upgrader-nxd4u5wu/DistUpgrade/DistUpgradeController.py", line 2114, in runPostInstallScripts
                               self._view.getTerminal().call([script], hidden=True)
                                                                                     File "/tmp/ubuntu-release-upgrader-nxd4u5wu/DistUpgrade/DistUpgradeView.py", line 249, in call
                                                                              subprocess.call(cmd)
                                                                                                    File "/usr/lib/python3.10/subprocess.py", line 347, in call
                                                          return p.wait(timeout=timeout)
                                                                                          File "/usr/lib/python3.10/subprocess.py", line 1209, in wait
                                                 return self._wait(timeout=timeout)
                                                                                     File "/usr/lib/python3.10/subprocess.py", line 1959, in _wait
                                             (pid, sts) = self._try_wait(0)
                                                                             File "/usr/lib/python3.10/subprocess.py", line 1917, in _try_wait
                                         (pid, sts) = os.waitpid(self.pid, wait_flags)
                                                                                      KeyboardInterrupt
                                                                                                       scosssscscohen@aigas:/escohen@aiscohen@aigscoscohen@aigas:scohen@scoscohessscoscsscsscscscohesscscoscoscohsscscohessscsssssco

Hey, thanks @bashing-om!

scohen@aigas:~$ ps -ef | grep 420617
root      420617  376054  0 16:23 pts/2    00:00:04 /usr/bin/dpkg --force-overwrite --status-fd 127 --configure --pending
scohen    565748  351662  0 17:46 pts/0    00:00:00 grep --color=auto 420617
scohen@aigas:~$ sudo kill -9 420617
scohen@aigas:~$ ps -ef | grep 420617
root      420617  376054  0 16:23 ?        00:00:04 [dpkg] <defunct>
scohen    566354  351662  0 17:46 pts/0    00:00:00 grep --color=auto 420617
scohen@aigas:~$ sudo apt --fix-broken install
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

Note that killing it only made it ‘defunct’

OK, so following its advice, we get

$ sudo dpkg --configure -a
Setting up network-manager-gnome (1.34.0-1ubuntu3) ...
Installing new version of config file /etc/xdg/autostart/nm-applet.desktop ...
Setting up network-manager-config-connectivity-ubuntu (1.46.0-1ubuntu2.2) ...
Setting up brltty (6.6-4ubuntu5) ...
...
Installing new version of config file /etc/brltty/Text/win-1252.tti ...
brltty.service is a disabled or a static unit not running, not starting it.
brltty-udev.service is a disabled or a static unit not running, not starting it.
brltty-udev.service is a disabled or a static unit not running, not starting it.
brltty.service is a disabled or a static unit not running, not starting it.
Setting up screen-resolution-extra (0.18.3) ...
Setting up gnome-initial-setup (46.3-1ubuntu3~24.04.1) ...
Setting up network-manager-pptp-gnome (1.2.12-3build2) ...
Setting up gdm3 (46.2-1ubuntu1~24.04.1) ...
Installing new version of config file /etc/gdm3/Xsession ...
Installing new version of config file /etc/gdm3/config-error-dialog.sh ...
Installing new version of config file /etc/pam.d/gdm-smartcard-pkcs11-exclusive ...
Installing new version of config file /etc/pam.d/gdm-smartcard-sssd-exclusive ...
Installing new version of config file /etc/pam.d/gdm-smartcard-sssd-or-password ...
Removing obsolete conffile /etc/dbus-1/system.d/gdm.conf ...
Setting up nvidia-settings (510.47.03-0ubuntu4) ...
Setting up packagekit (1.2.8-2ubuntu1.2) ...
Installing new version of config file /etc/apt/apt.conf.d/20packagekit ...
Setting up modemmanager (1.23.4-0ubuntu2) ...
Setting up libgamemode0:amd64 (1.8.1-2build1) ...
Setting up policykit-1 (124-2ubuntu1.24.04.2) ...
Setting up libpam-fprintd:amd64 (1.94.3-1) ...
Setting up network-manager-openvpn (1.10.2-4build2) ...
Setting up packagekit-tools (1.2.8-2ubuntu1.2) ...
Setting up network-manager-openvpn-gnome (1.10.2-4build2) ...
Setting up software-properties-common (0.99.49.2) ...
Setting up gstreamer1.0-packagekit (1.2.8-2ubuntu1.2) ...
Setting up gamemode (1.8.1-2build1) ...
Setting up software-properties-gtk (0.99.49.2) ...
Setting up aptdaemon (1.1.1+bzr982-0ubuntu44) ...
Setting up python3-aptdaemon (1.1.1+bzr982-0ubuntu44) ...
/usr/lib/python3/dist-packages/aptdaemon/core.py:96: SyntaxWarning: invalid escape sequence '\-'
  REGEX_VALID_PACKAGENAME = "^[a-z0-9][a-z0-9\-+.]+(:[a-z0-9]+)?$"
/usr/lib/python3/dist-packages/aptdaemon/core.py:99: SyntaxWarning: invalid escape sequence '\-'
  REGEX_VALID_VERSION = "^[0-9][0-9.+\-A-Za-z:~]*$"
/usr/lib/python3/dist-packages/aptdaemon/core.py:101: SyntaxWarning: invalid escape sequence '\-'
  REGEX_VALID_RELEASE = "^[a-zA-Z0-9_\-\.]+$"
/usr/lib/python3/dist-packages/aptdaemon/progress.py:57: SyntaxWarning: invalid escape sequence '\['
  REGEX_ANSI_ESCAPE_CODE = chr(27) + "\[[;?0-9]*[A-Za-z]"
/usr/lib/python3/dist-packages/aptdaemon/progress.py:667: SyntaxWarning: invalid escape sequence '\s'
  match = re.match("\s*\'(.*)\'\s*\'(.*)\'.*", message_raw)
/usr/lib/python3/dist-packages/aptdaemon/progress.py:791: SyntaxWarning: invalid escape sequence '\s'
  match = re.match("\s*\'(.*)\'\s*\'(.*)\'.*", status[3])
/usr/lib/python3/dist-packages/aptdaemon/worker/aptworker.py:462: SyntaxWarning: invalid escape sequence '\S'
  if re.match("(http|https|ftp)://\S+?:\S+?@\S+", uri):
/usr/lib/python3/dist-packages/aptdaemon/worker/pkworker.py:89: SyntaxWarning: invalid escape sequence '\d'
  MATCH_CVE = "CVE-\d{4}-\d{4}"
/usr/lib/python3/dist-packages/aptdaemon/worker/pkworker.py:325: SyntaxWarning: invalid escape sequence '\/'
  pattern = "^%s$" % filename[1:].replace("/", "\/")
/usr/lib/python3/dist-packages/aptdaemon/worker/pkworker.py:327: SyntaxWarning: invalid escape sequence '\/'
  pattern = "\/%s$" % filename
/usr/lib/python3/dist-packages/aptdaemon/worker/pkworker.py:350: SyntaxWarning: invalid escape sequence '\/'
  pattern = "^%s$" % filename.replace("/", "\/")
/usr/lib/python3/dist-packages/aptdaemon/worker/pkworker.py:352: SyntaxWarning: invalid escape sequence '\/'
  pattern = ".*\/%s$" % filename
/usr/lib/python3/dist-packages/aptdaemon/worker/pkworker.py:661: SyntaxWarning: invalid escape sequence '\+'
  "(?P<date>.+) (?P<offset>[-\+][0-9]+)$",
Setting up python3-aptdaemon.gtk3widgets (1.1.1+bzr982-0ubuntu44) ...
Setting up apturl (0.5.2ubuntu23) ...
Setting up language-selector-gnome (0.225) ...
Setting up gnome-control-center (1:46.5-0ubuntu0.24.04.1) ...
Setting up update-manager (1:24.04.9) ...
Setting up update-notifier (3.192.68.1) ...
Setting up ubuntu-desktop-minimal (1.539.2) ...
Setting up ubuntu-desktop (1.539.2) ...
Processing triggers for initramfs-tools (0.142ubuntu25.5) ...
update-initramfs: Generating /boot/initrd.img-6.8.0-57-generic
Processing triggers for dictionaries-common (1.29.7) ...
aspell-autobuildhash: processing: en [en-common].
aspell-autobuildhash: processing: en [en-variant_0].
aspell-autobuildhash: processing: en [en-variant_1].
aspell-autobuildhash: processing: en [en-variant_2].
aspell-autobuildhash: processing: en [en-w_accents-only].
aspell-autobuildhash: processing: en [en-wo_accents-only].
aspell-autobuildhash: processing: en [en_AU-variant_0].
aspell-autobuildhash: processing: en [en_AU-variant_1].
aspell-autobuildhash: processing: en [en_AU-w_accents-only].
aspell-autobuildhash: processing: en [en_AU-wo_accents-only].
aspell-autobuildhash: processing: en [en_CA-variant_0].
aspell-autobuildhash: processing: en [en_CA-variant_1].
aspell-autobuildhash: processing: en [en_CA-w_accents-only].
aspell-autobuildhash: processing: en [en_CA-wo_accents-only].
aspell-autobuildhash: processing: en [en_GB-ise-w_accents-only].
aspell-autobuildhash: processing: en [en_GB-ise-wo_accents-only].
aspell-autobuildhash: processing: en [en_GB-ize-w_accents-only].
aspell-autobuildhash: processing: en [en_GB-ize-wo_accents-only].
aspell-autobuildhash: processing: en [en_GB-variant_0].
aspell-autobuildhash: processing: en [en_GB-variant_1].
aspell-autobuildhash: processing: en [en_US-w_accents-only].
aspell-autobuildhash: processing: en [en_US-wo_accents-only].
Processing triggers for rsyslog (8.2312.0-3ubuntu9.1) ...
Processing triggers for ufw (0.36.2-6) ...
Processing triggers for linux-image-6.8.0-57-generic (6.8.0-57.59) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 6.8.0-57-generic
 * dkms: autoinstall for kernel 6.8.0-57-generic
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-6.8.0-57-generic
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/oem-flavour.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.8.0-57-generic
Found initrd image: /boot/initrd.img-6.8.0-57-generic
Found linux image: /boot/vmlinuz-6.5.0-1022-oem
Found initrd image: /boot/initrd.img-6.5.0-1022-oem
Found memtest86+ 64bit EFI image: /boot/memtest86+x64.efi
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
Generating 'Restore Ubuntu 22.04 to factory state' entry ...
done**strong text**
Processing triggers for rygel (0.42.5-1ubuntu3) ...
Processing triggers for ca-certificates (20240203) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
Processing triggers for libgdk-pixbuf-2.0-0:amd64 (2.42.10+dfsg-3ubuntu3.1) ...
Processing triggers for sgml-base (1.31) ...
Processing triggers for libc-bin (2.39-0ubuntu8.4) ...

Then, we can run

$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  acpi-support aisleriot apturl apturl-common attr branding-ubuntu brasero brasero-common cd-boot-images-amd64 cdrdao cheese cheese-common dctrl-tools dmeventd dpkg-repack 
...
  python3-protobuf python3-pyatspi python3-pymacaroons python3-rfc3339 samba samba-ad-provision samba-vfs-modules screen-resolution-extra tdb-tools thin-provisioning-tools xserver-xorg-video-nvidia-535
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

So is this installation now complete and worth a try booting? Or should I do something else first?

Well - A few ways we can look to know what is holding the lock.
The less intrusive in my optnion:

sudo lsof /var/lib/dpkg/lock

and from there - we have a couple of options to remove the lock; depending on what dpkg reports.

the good news here is that ubuntu - given time and effort (and maybe a live USB) - is always fixable.

-a matter of time-

Just edited previous post, more info. Thanks again.

Your last posting’s update - results look good …

Reboot and let’s see.

-good things can happen too-

1 Like

I am starting to doubt that but I will take the plunge. Thanks again for all your help.

OK, this worked. Thank you very much.

Great -
At this point I do suggest checks for cheap insurance of no issues and some clean up.

sudo apt update
sudo apt dist-upgrade
sudo dpkg -C

cleanup:

sudo apt --purge autoremove
dpkg -l | awk '/^rc/{print $2}' | xargs sudo dpkg -P

where “^rc” are packages (r)emoved but (c)onfig files remain.

-me likes clean-

2 Likes

Did this. Me likes clean, too.

But, but, but …

I rebooted and now my second monitor no longer works!! Settings detects its presence, but no displays come on it. Prior to this step it was working.

AND my nvidia-settings app is gone, which is probably related!

Aargh!

stevecoh1 - Yuk

An unpleasant surprise - a first time for everything, I guess.
I will meet with you in your new thread.
For those following along the new thread is:
< After Upgrade from 22.04 to 24.04, second monitor won't function - part 2>

-Looks like ^ bad things can happen, too-

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.