Question

Ubuntu upgrade from 18.04 to 20.04 hangs

I’m attempting to upgrade a droplet to Ubuntu 20.04, but the process always hangs at the same step:

Installing new version of config file /etc/cloud/cloud.cfg ...

After sitting on this step around 20 minutes, it disconnects, and I’m left unable to SSH back in. I’ve tested this three times now, including once from the web console, and it’s always this same step that hangs. No error, just…nothing.

I’ve had an ongoing support ticket for this, but their responses are not only slow but so far entirely unhelpful.

Can anyone recommend a solution, or anything I might try?


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

After many many failed attempts, I was finally able to troubleshoot this issue so that I can access my droplet normally again. The upgrade to 20.04 seems to be successful, and remaining errors are resolved (as far as I can tell).

The solution centered around recovering the grub build, which fixes the kernel panic. I was unable to do this without first addressing several other errors (see below), but here are the steps recommended by support:

  1. First, boot your droplet into the Recovery ISO then access the Droplet using the console via your Cloud Panel login, or you may access the Recovery ISO via SSH by connecting to your Droplet’s IP while it’s booted into the Recovery ISO.

2) Once connected to the recovery environment, use option #6 at the Recovery menu to be placed at a root BASH shell where the remaining steps can be performed.

  1. Mount your Droplet’s disk by issuing the below commands, one at a time:

mount /dev/vda1 /mnt

mount --bind /dev /mnt/dev

mount --bind /dev/pts /mnt/dev/pts

mount --bind /proc /mnt/proc

mount --bind /sys /mnt/sys

  1. Attempt to chroot into the filesystem that you’ve just mounted:

chroot /mnt/

  1. Reinstall the GRUB bootloader:

grub-install /dev/vda

update-grub

  1. Navigate back to the Cloud panel and switch the Droplet back to booting from its own Hard Disk, then power the Droplet off/on.

Again, these steps did work in the end, but before I could follow them successfully, I first had to troubleshoot these errors:

E: dpkg was interrupted

This one is simple to resolve by using the command suggested in the error: sudo dpkg --configure -a. This error must be resolved before the next one can be.

grub-install: error: /usr/lib/grub/i386-pc/modinfo.sh doesn't exist.   Please specify --target or --directory.

I was able to resolve this with sudo apt-get install grub-pc.

Temporary failure resolving 'mirrors.digitalocean.com'

This was part of a series of errors and warnings I got after correcting the dpkg error and trying to run grub-install. This seemed to be related to nameservers on /etc/resolv.conf, and though I don’t know why, this seemed to solve it both times I tried:

  1. From the recovery menu, use options 1 and 5 in the recovery menu to mount the disk image and chroot in.
  2. Open the resolv.conf file with vi /etc/resolv.conf and close without saving. (Maybe someone else can explain why this worked?)
  3. Exit back out to recovery menu and use option #6 to continue with grub recovery steps.

I was having the same issue and resolved it by completely removing cloud-init. See https://askubuntu.com/a/1068584.

I had the same problem, except the SSH disconnection happened immediately after the message about installing a new version of cloud.cfg. Not only could I no longer ssh in, but ping to the server failed.

I had done apt dist-upgrade in 18.04, but forgot to do apt update first. Don’t know if this caused the problem, but it wasn’t fatal (I had a recent droplet backup just in case).

I waited an hour, "Power Cycle"d the droplet from the Digital Ocean control panel (https://cloud.digitalocean.com/droplets/<id>/power), and it rebooted with a fresh install of Ubuntu 20.04. So far, it appears that everything is working, at least I can SSH in, apt dist-upgrade (after apt install) found nothing to do except remove unused packages, emacs (26.3) works, and the Pleroma instance I’m running there is working.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.