upgrading wrongly from ubuntu 18.04.6LTS to 21

Solution 1:

See this question Asked by me, here, you will find out what things you have done wrong

FYI: the update error is because the bionic beaver has some repositories which were removed from hirsute, removing those repositories and running apt upgrade will work

FYI: Don't do these types of things, please, You cannot should not upgrade to a non-LTS release from LTS release (You are upgrading 18.04 to 21.04!!)

First, disable all PPAs before proceeding(sudo mv /etc/apt/sources.list.d/* $HOME)

As you mentioned in the question, you want an LTS release

Currently, 20.04 is the latest LTS release, but you have already changed a few packages to hirsute. Thus, you cannot should not upgrade to 20.04 (As a few packages will be downgraded and downgrading is unsecured and may break the system or make some packages unusable)

Let us upgrade to hirsute (a none LTS release)

First, change the contents of sources.list* to

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

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

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

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

deb http://archive.canonical.com/ubuntu hirsute partner
deb-src http://archive.canonical.com/ubuntu hirsute partner

After that run sudo apt update

I don't think so It will say any errors

After this run this

sudo snap refresh 
sudo mv /etc/apt/sources.list.d/* $HOME
sudo apt dist-upgrade && sudo apt full-upgrade 

You are done! It will work


*- sources.list is available in /etc/apt/, the full path is /etc/apt/sources.list. man sources.list will also help .