Preparations

I recommend installing either ubuntu-server or ubuntu-desktop before the upgrade, unless you are upgrading Ubuntu in a container.

Error remediations

If do-release-upgrade succeeded with errors, you may attempt to fix those errors with:

apt install -f

and run autoremove manually:

apt list '?obsolete' # manually review the list
apt autopurge <pkgs> # same as apt autoremove --purge

See also apt.