Question

Getting an error during Ubuntu upgrade 16.04 ->18.04

Posted October 18, 2021 155 views
Ubuntu 16.04Ubuntu 18.04

Hello all,
I am a bit of a novice here to please bear with me.
I need to upgrade my droplet from 16.04LTS to 18.04LTS in order to allow my mattermost application server to continue to work.
After running the do-release-upgrade command I get the following error:

After updating your package information, the essential package
‘ubuntu-minimal’ could not be located. This may be because you have
no official mirrors listed in your software sources, or because of
excessive load on the mirror you are using. See /etc/apt/sources.list
for the current list of configured software sources.
In the case of an overloaded mirror, you may want to try the upgrade
again later.

I am not sure how to proceed from here. Any suggestions would be very much appreciated.
Thank you
Gene

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.

×
Submit an Answer
1 answer

Hi @GeneIntheUK,

First, I’ll recommend upgrading to 20.04 as 18.04 will be EOL soon as well and you’ll have a similar problem on your hands when you try to upgrade again. Better to do it all now.

As for the problem. It seems you are missing some repositories. What you can do is add the official repos like so :

  1. Make a copy of your source list: bash sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak Get the the sources for Ubuntu 20.04 or 18.40 from sources.list in github :

Ubuntu 20.04 LTS (Focal Fossa) – Full sources.list

deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse

deb http://archive.canonical.com/ubuntu focal partner
deb-src http://archive.canonical.com/ubuntu focal partner
  • Open the list and add these lines at the end

    sudo nano /etc/apt/sources.list
    
  • Update sources and install all available updates for 19.10 and reboot your system:

    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get dist-upgrade
    sudo apt-get autoremove
    sudo reboot
    
  • Ensure you have the lts path at the update-manager:

    $ cat /etc/update-manager/release-upgrades
    Prompt=lts
    

If you upgrade over ssh: ensure your firewall allows ssh access over port 1022 (recovery-ssh-port). You don’t need to use the port, it is just in case.

  • Run the Upgrade bash sudo do-release-upgrade

Additionally, I’ll recommend creating a backup before beginning. Just to be on the safe side.