How can I recover a partially upgraded Ubuntu server after a failed upgrade?
#1
I just tried to upgrade my Ubuntu server from 20.04 to 22.04 using the `do-release-upgrade` command, but it failed halfway through. Now I'm stuck with a partially upgraded system that won't boot properly, and I can't seem to get the network manager to start so I can even try to fix it remotely.
Reply
#2
That sounds brutal. I had a similar halfway upgrade once. I booted into recovery mode, dropped to a root shell, then ran apt-get -f install and dpkg --configure -a to fix broken packages, and checked /var/log/dist-upgrade for clues. After that I tried a reboot and a different kernel, but the system still wouldn’t boot cleanly. In the end I booted from a rescue USB, mounted the root partition, chrooted, and completed the upgrade there. Not elegant, but it worked eventually.
Reply
#3
Networking on a headless server can be tricky after an upgrade. In my case the NetworkManager service refused to start even though the config looked fine. I checked systemctl status NetworkManager, enabled it, and also verified netplan had a config under /etc/netplan. If you’re not using NetworkManager on a server, the fix might be to ensure systemd-networkd or netplan is actually managing the interface rather than forcing NetworkManager to take over.
Reply
#4
Grub and kernel issues can masquerade as a networking problem. I would try booting into an older kernel from GRUB and see if the machine boots, then attempt to finish the upgrade from there or use a chroot to repair the dist-upgrade once you’re in a working environment.
Reply
#5
Do you have out of band or console access to the machine so you can recover without relying on remote networking?
Reply


[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Forum Jump: