Can't upgrade from Ubuntu 18.04 to 20.04 due to block of third-party software

I am updating my Kubuntu 18.04 to 20.04 LTS following the instructions of this tutorial.

When I get to the part of:

sudo do-release-upgrade

I get an error that halts the system upgrade. This is the error stack in the console:

Third party sources disabled 

Some third party entries in your sources.list were disabled. You can 
re-enable them after the upgrade with the 'software-properties' tool 
or your package manager. 

To continue please press [ENTER]

Hit http://nl.archive.ubuntu.com/ubuntu focal InRelease                                                                                                                                                               
Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]                                                                                                                                             
Hit http://nl.archive.ubuntu.com/ubuntu focal-updates InRelease                                                                                                                                                       
Hit http://nl.archive.ubuntu.com/ubuntu focal-backports InRelease                                                                                                                                                     
Fetched 114 kB in 0s (0 B/s)                                                                                                                                                                                          

Checking package manager
Reading package lists... Done    
Building dependency tree          
Reading state information... Done

Calculating the changes

Calculating the changes

Could not calculate the upgrade 

An unresolvable problem occurred while calculating the upgrade. 

This was likely caused by: 
* Unofficial software packages not provided by Ubuntu 
Please use the tool 'ppa-purge' from the ppa-purge 
package to remove software from a Launchpad PPA and 
try the upgrade again. 

If none of this applies, then please report this bug using the 
command 'ubuntu-bug ubuntu-release-upgrader-core' in a terminal. If 
you want to investigate this yourself the log files in 
'/var/log/dist-upgrade' will contain details about the upgrade. 
Specifically, look at 'main.log' and 'apt.log'. 


Restoring original system state

Aborting
Reading package lists... Done    
Building dependency tree          
Reading state information... Done
=== Command detached from window (Fri Dec 24 10:56:10 2021) ===
=== Command terminated with exit status 1 (Fri Dec 24 10:56:20 2021) ===

However, a list of the disable third-party packages with:

$> grep disabled /var/log/dist-upgrade/main.log

Shows that relevant software like Postgres (with its databases) or QGIS are there. Thus, I cannot uninstall these packages with ppa-purge, since important data is stored there and I can't risk losing anything. But I cannot upgrade the system either, it seems.

Is there anything I can to here to bridge these circumstances?

I have read this, this, and this posts on SO or AskUbuntu, but none of them worked for me. Thanks!


postgresql has been causing this same problem since 2012.

In 2012 was posted the bug report of Bug #996916 : postgresql packages in the removal blacklist making it hard to upgrade , but no real solution.

I suggest to backup your database, then remove all postgress-related packages, upgrade, re-install packages, finally returning the databases.