Question

Updating Ubuntu 16.04 to 20.04

Is there, anywhere on the internet, a reliable step-by-step guide on how to upgrade from Ubuntu 16.04 to 20.04? Apparently it has to be done via 18.04. I have updated the current 16.04 system by:

  • sudo ufw allow 1022/tcp

  • sudo apt update && sudo apt upgrade

After this i get the message: The following packages have been kept back: cloud-init

I guess that is why the system upgrade fails:

  • sudo do-release-upgrade

gives the message: Please install all available updates for your release before upgrading.

Thanks for any help! David


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.

I’m working on this same process right now. I ran into the same issue with cloud-init. After installing it, I was able to get back pm track and update from 16.04 to 18.04 successfully.

My only issue at that point was disabling apache2.

Then I did the same process to connect to 20.04 and while it worked, I was unable to connect to my droplet any more and couldn’t figure out what was happening.

Hi,

@DavidKo wrote
I don’t find any useful information that explains if upgrading via 18.04 means...

You need to do an upgrade in two steps

  • from 16.04 to 18.04
  • from 18.04 to 20.04

Each time you do that with a command

sudo do-release-upgrade
@DavidKo wrote
After this i get the message: The following packages have been kept back: cloud-init I guess that is why the system upgrade fails

That is probably the cause of the failure. You could try to do some steps to fix it but before doing anything I recommend making a snapshot of the droplet. You could try to (re)install the package that has been kept back.

sudo apt install cloud-init

You may get the questions about replacing packages with the new ones during the installation. Agree to that.

Let me know if it works, pls.

Edit: I don’t find any useful information that explains if upgrading via 18.04 means:

  • the upgrade process will do this by itself in two steps
  • I need to specify 18.04 in the command since otherwise it will try to go straight to 20.04
  • I need to do the upgrade twice; first the upgrade command will upgrade to 18.04. Then I will have to run the upgrade again and it will install 20.04

//David