Can't upgrade Ubuntu 18.04 to 20.04 because of "Please install all available updates for your release before upgrading" error

sequence from 18.04 to 20.04

sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt autoremove
sudo do-release-upgrade -d -f DistUpgradeViewGtk3

Follow onscreen instruction. Good luck!


I was also experiencing the same issue. However, when I ran the usual upgrade commands (sudo apt upgrade, sudo apt full-upgrade, sudo apt-get dist-upgrade), they were all reporting that there are no packages to upgrade and no held packages:

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

In the end, I copied the file /usr/bin/do-release-upgrade to my home and modified it as follows:

for pkg in upgradable:
    if 'Phased-Update-Percentage' in pkg.candidate.record:
        # P-U-P does not exist if it is fully phased
        continue
    else:
        install_count += 1
        print(pkg)   # <--- ADD THIS LINE
        # one upgradeable package is enough to stop the dist-upgrade
        # break      # <--- COMMENT THIS LINE OUT to get all packages

This change will print the names of all packages that need to be upgraded.

When I ran sudo ~/do-release-upgrade, a package from an external repository was printed that had an update available, but the newer version depended on a library that was not available, which caused the package to not upgrade.

Still not sure why it wasn't reported as not upgraded by apt upgrade.

Edit: The following code snippet can be run in the Python console to list all upgradeable packages - thanks @jferard!

import apt

cache = apt.Cache()
cache.open()
print([pkg for pkg in cache if pkg.is_upgradable])