✓ Solved

Upgrade from Ubuntu 16.04 to 18.04 fails

I'm trying to upgrade my Ubuntu 16.04 to 18.04 by following the guide at https://www.linode.com/docs/guides/upgrade-to-ubuntu-18-04/ and while running do-release-upgrade I get the following message and the process rolls back:

Invalid package information

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.

Restoring original system state

Aborting
Reading package lists… Done
Building dependency tree
Reading state information… Done

Any ideas on what might be wrong here? I didn't get the message about the mirror list that the guide said might happen, and I got a lengthy list of 3rd party sources that were disabled for the upgrade, but other than that, I don't know what has gone wrong.

1 Reply

✓ Best Answer

It looks like your /etc/apt/sources.list file is misconfigured. Normally when you run the do-release-upgrade command, it parses through the /etc/apt/sources.list file and runs the upgrade using those mirrors listed in this file which point out to the public internet. Same also applies to running an update and upgrade(apt-get update && upgrade -y).

You can run this curl command which will rebuild your sources.list file.
curl https://repogen.simplylinux.ch/txt/bionic/sources_69b5961c58144740321b2f2e4098c798d89612df.txt | sudo tee /etc/apt/sources.list

This will replace your /etc/apt/sources.list with the following:

#------------------------------------------------------------------------------#
#                            OFFICIAL UBUNTU REPOS                             #
#------------------------------------------------------------------------------#


###### Ubuntu Main Repos
deb http://de.archive.ubuntu.com/ubuntu/ bionic main restricted universe 
deb-src http://de.archive.ubuntu.com/ubuntu/ bionic main restricted universe 

###### Ubuntu Update Repos
deb http://de.archive.ubuntu.com/ubuntu/ bionic-security main restricted universe 
deb-src http://de.archive.ubuntu.com/ubuntu/ bionic-security main restricted universe 

From there, you would run apt-get update; apt-get upgrade to verify that everything is set correctly.

This thread and guide from askubuntu.com and Linuxbabe has some good information on how to get this resolved taking a different approach.

This community post on our Community Question site also provide a more detailed explanation on the best way to approach this and some preliminary steps you should take which includes backing up your data. Inline distribution upgrades can present some unpredictable results and therefore it is usually not recommended. You'll be better off deploying a new Linode with Ubuntu 18.04.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct