I'm surprised: 8 years later, the bug is still here.
I wanted to upgrade from 18.04 to 20.04 and faced the exact same issue caused by postgis.
What worked for me were to remove postgis, do the upgrade, and re-install postgis:
sudo apt remove postgresql-12-postgis-*
sudo do-release-upgrade
sudo apt install postgresql-12-postgis-3
I'm surprised: 8 years later, the bug is still here.
I wanted to upgrade from 18.04 to 20.04 and faced the exact same issue caused by postgis.
What worked for me were to remove postgis, do the upgrade, and re-install postgis:
sudo apt remove postgresql- 12-postgis- *
sudo do-release-upgrade
sudo apt install postgresql- 12-postgis- 3