Ubuntu won’t boot after a restart during the update from 18.04 to 20.04

Got the same issue upgrading from 19.10. I'm still in the process of fixing it, but I've managed to get through your problem.

Try booting in advanced mode on an older kernel (that is, older than 5.4).

When the advanced screen comes up, use the root shell and execute this command:

dpkg -l | grep linux-image

Find out the status at the beginning of the line on the last package. Status ii means installed correctly, but mine was it, which means some triggers were pending. I ran

dpkg --triggers-only linux-image-5.4.0-29-generic

and got the system to unblock (substitute the package name which shows it).

Then ran apt autoremove to clean packages and kernels.

From then on you reboot and then you might be able to progress with the upgrade.


I had the same problem...

The update process does not generate a proper initrd.img. To solve this I booted into an older kernel and then did a

sudo update-initramfs -u -k 5.4.0-26-generic (replace this with your version)

sudo update-grub

Then reboot. My system is booting OK now.


Here are the steps I had to follow to fix my failed update from 19.10. It is a mix of Jogi's answer, grimmlink's answer, and kubanczyk's comment.

Step 1
Reboot (restart) your machine into recovery mode:

You will need to hold down left shift and/or slowly repeatedly press esc; if you spam the esc to much key you'll end up in the grub shell. A black screen should appear with a list of options. Select the one that has Advanced options at the start. A new list appears. Now select an older kernel option that has recovery at the end of it.

If 5.4.0-29 is in the list and is the newest (highest) number choose a recovery option that is lower than it. I used something like linux-image-5.3.#.# (recovery).

Step 2
Drop into a root shell once everything is done loading. This is the root option from the list of options. If your screen has a bunch of artifacts making it hard to see, select the root option and then press ctrl + d to cancel that choice, this should clear the screen and make it visible again.

Once in root shell you could take this time to copy your data off the disk in case you did not do that before the failed upgrade; you will need to look up another post on how to do that.

Now run the following command to see your upgrades install status:

dpkg -l | grep linux-image

If the start of the line next to the highest kernel version is ii this means the install was successful and you probably just need to go to Step 3. iU means the files are present and unpacked but not installed properly. iT means the install was held up by triggers that did not run. Proceed accordingly:

Step 2: iU status
You will need to reinstall the failed image with the following commands. Credit to Jogi.

sudo update-initramfs -u -k 5.4.0-26-generic # <--- replace with your version!
sudo update-grub
reboot

Step 2: iT status
You need to run the triggers for the update manually. Credit grimmlink.

dpkg --triggers-only linux-image-5.4.0-29-generic # <--- replace with your version!
reboot

Step 3
At this point you should be able to boot into Ubuntu. If like me the GUI is still broken but you can technically see the login screen/ login to your system you will need to do the following:

Go back into recovery mode and drop into root shell again. NOTE: You can probably use the latest kernel version now instead of the older one; I used the older. Run these commands. Partial credit to kubanczyk.

dpkg --configure -a
apt --fix-broken install
reboot

You should now have a working Ubuntu 20. If not something else is wrong or something did not update like it was supposed to.

Troubleshooting
The key commands to remember for your troubleshooting are below. NOTE: I kept the sudo Jogi added to the commands but your root already so they are most likely unnecessary:

sudo update-initramfs -u -k 5.4.0-26-generic # <--- replace with your version!
sudo update-grub
dpkg --configure -a
apt --fix-broken install