Upgrade Ubuntu 16.04 to 18.04

I’ve inherited a bit of a mess. let me say right up front that I’m a total noob with Linux. I’ve done some router work, but it’s been on the simpler side.

This site has been going down frequently, so the first thing I checked for was updates. It was running 16.04.2, and the login screen showed 341 packages needed updating, 184 of which were security updates (yikes).

So after reading some docs here, I got a snapshot taken, then ran sudo apt-get update and sudo apt-get upgrade, followed by sudo apt autoremove. That all went great and I got it up to 16.04.7.

It looks though like 16.04.x is old hat, so I tried to upgrade to 18.04. using sudo apt-get dist-upgrade. During that, I get the error message “the essential package ‘ubuntu-minimal’ could not be located”. Searching, I found this:

It looks like they were going from cosmic (18) to disco (19), but it was pretty spot on. I found all the lines in sources.list commented out, and some were pointing to xenial while others were pointed to bionic. I followed Vivien Milat (d-ubnntu-t) 's lead by un-commenting all the lines, and setting all the references to bionic. Upgrade won’t complete however and indicates that some of the packages may be broken.

Any thoughts/ideas on what I should do from here? It looks like I should setup another droplet, do a clean install of 20, then move things over. But I’m not sure how to even start with that. If I had my choice, I’d like to find a way of getting this upgrade to work as it seems simpler, but I really don’t have any clue if it would be or not.

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.

Bobby Iliev
Site Moderator
Site Moderator badge
July 21, 2022


It looks like the ubuntu-minimal package was not available on the DigitalOcean mirrors, what you could do is quickly change them to the archive Ubuntu ones:

  • Take a backup of the /etc/apt/sources.list file:
cp /etc/apt/sources.list /etc/apt/sources.list-backup
  • Then change the repos:
sudo sed -i "s/mirrors\.digitalocean/archive.ubuntu/g" /etc/apt/sources.list

Finally, proceed with the upgrade as normal.

For more information I could suggest the following tutorial:



Site Moderator
Site Moderator badge
July 6, 2022

Hi @schaferwood,

So far you’ve done really good! Additionally, yes bionic is the way to go.

As for the upgrade try doing:

apt update
apt upgrade

and then the distro update one.

If there are packages that have broken dependencies or the packages themselves are broken, you’ll need to fix them one by one. If they are a lot maybe a new Droplet and a migration of your Data is a better solution.

Try DigitalOcean for free

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

Sign up