18.04 → 20.04 Upgrade fails: 'E:Unable to correct problems, you have held broken packages.'

I am trying to update Ubuntu to 20.04 but it aborts every time I execute

$ sudo do-release-upgrade

The output is:

$ sudo do-release-upgrade
Checking for a new Ubuntu release
Get:1 Upgrade tool signature [1.554 B]                                                                                                                                                  
Get:2 Upgrade tool [1.342 kB]                                                                                                                                                           
Fetched 1.344 kB in 0s (0 B/s)                                                                                                                                                          
authenticate 'focal.tar.gz' against 'focal.tar.gz.gpg' 
extracting 'focal.tar.gz'

Reading cache

Checking package manager
Reading package lists... Done
Building dependency tree        
Reading state information... Done
Hit ...                                                                                              
Fetched 64,4 kB in 0s (0 B/s)                                                                                                                                                           
Reading package lists... Done    
Building dependency tree          
Reading state information... Done

Checking for installed snaps

Calculating snap size requirements

Updating repository information

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]

Get:1 ...
                                                                              
Fetched 40,6 MB in 6s (6.708 kB/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

The main.log states

$ cat /var/log/dist-upgrade/main.log
2020-09-30 16:21:06,928 DEBUG Using 'DistUpgradeViewText' view
2020-09-30 16:21:06,980 DEBUG enable dpkg --force-overwrite
2020-09-30 16:21:07,016 DEBUG creating statefile: '/var/log/dist-upgrade/apt-clone_system_state.tar.gz'
2020-09-30 16:21:14,394 DEBUG lsb-release: 'bionic'
2020-09-30 16:21:14,395 DEBUG _pythonSymlinkCheck run
2020-09-30 16:21:14,395 DEBUG openCache()
2020-09-30 16:21:14,396 DEBUG quirks: running PreCacheOpen
2020-09-30 16:21:14,396 DEBUG running Quirks.PreCacheOpen
2020-09-30 16:21:15,760 DEBUG Comparing 4.15.0-117 with 
2020-09-30 16:21:15,761 DEBUG Comparing 4.15.0-118 with 4.15.0-117
2020-09-30 16:21:16,033 DEBUG /openCache(), new cache size 100547
2020-09-30 16:21:16,033 DEBUG need_server_mode(): run in 'desktop' mode, (because of pkg 'ubuntu-desktop')
2020-09-30 16:21:16,033 DEBUG checkViewDepends()
2020-09-30 16:21:16,034 DEBUG running doUpdate() (showErrors=False)
2020-09-30 16:21:19,829 DEBUG openCache()
2020-09-30 16:21:21,156 DEBUG Comparing 4.15.0-117 with 
2020-09-30 16:21:21,156 DEBUG Comparing 4.15.0-118 with 4.15.0-117
2020-09-30 16:21:21,506 DEBUG /openCache(), new cache size 100547
2020-09-30 16:21:21,506 DEBUG doPostInitialUpdate
2020-09-30 16:21:21,507 DEBUG quirks: running focalPostInitialUpdate
2020-09-30 16:21:21,507 DEBUG running Quirks.focalPostInitialUpdate
2020-09-30 16:21:23,560 DEBUG Snap core18 is installed
2020-09-30 16:21:23,860 DEBUG Snap gnome-3-34-1804 is installed
2020-09-30 16:21:23,862 DEBUG Snap gnome-3-34-1804 is not tracking the release channel
2020-09-30 16:21:24,068 DEBUG Snap gtk-common-themes is installed
2020-09-30 16:21:24,376 DEBUG Snap snap-store is installed
2020-09-30 16:21:24,376 DEBUG Snap snap-store is not tracking the release channel
2020-09-30 16:21:24,682 DEBUG Snap gnome-3-28-1804 is installed
2020-09-30 16:21:24,683 DEBUG Snap gnome-3-28-1804 is not tracking the release channel
2020-09-30 16:21:24,902 DEBUG Snap gnome-calculator is installed
2020-09-30 16:21:25,089 DEBUG Snap gnome-characters is installed
2020-09-30 16:21:25,298 DEBUG Snap gnome-logs is installed
2020-09-30 16:21:28,247 DEBUG MetaPkgs: ubuntu-desktop
2020-09-30 16:21:36,258 DEBUG Foreign: audio-recorder com.github.babluboy.nutty containerd.io contractor docker-ce docker-ce-cli google-chrome-stable icu-devtools keepassxc krita krita-data libapache2-mod-php libapache2-mod-php5.6 libapache2-mod-php7.0 libapache2-mod-php7.1 libapache2-mod-php7.2 libapache2-mod-php7.3 libapache2-mod-php7.4 libdrm-amdgpu1 libdrm-amdgpu1:i386 libdrm-common libdrm-intel1 libdrm-intel1:i386 libdrm-nouveau2 libdrm-nouveau2:i386 libdrm-radeon1 libdrm-radeon1:i386 libdrm2 libdrm2:i386 libegl-dev libegl-mesa0 libegl1 libegl1-mesa libegl1-mesa-dev libgbm1 libgd3 libgl-dev libgl1 libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-dri:i386 libgl1-mesa-glx libgl1-mesa-glx:i386 libgl1:i386 libglapi-mesa libglapi-mesa:i386 libgles-dev libgles1 libgles2 libgles2-mesa-dev libglvnd-dev libglvnd0 libglvnd0:i386 libglx-dev libglx-mesa0 libglx-mesa0:i386 libglx0 libglx0:i386 libgranite-common libgranite5 libicu-dev libicu65 libidn2-0 libllvm10 libllvm10:i386 libnorm1 libopengl-dev libopengl0 libpcre16-3 libpcre2-8-0 libpcre3 libpcre3-dev libpcre32-3 libpcre3:i386 libpcrecpp0v5 libpython-stdlib libpython2-stdlib libsodium23 libssl1.1 libwayland-egl1-mesa libxatracker2 libxml2 libxml2-utils libzip4 libzmq5 mesa-va-drivers mesa-vdpau-drivers mesa-vulkan-drivers mesa-vulkan-drivers:i386 meson obs-studio openssl peek php php-apcu php-apcu-bc php-cli php-common php-curl php-gd php-igbinary php-intl php-ldap php-mbstring php-mysql php-redis php-soap php-sqlite3 php-xml php-xmlrpc php-zip php5.6 php5.6-bcmath php5.6-cli php5.6-common php5.6-curl php5.6-gd php5.6-json php5.6-mbstring php5.6-mysql php5.6-opcache php5.6-readline php5.6-soap php5.6-xml php5.6-zip php7.0 php7.0-bcmath php7.0-bz2 php7.0-cli php7.0-common php7.0-curl php7.0-gd php7.0-gmp php7.0-intl php7.0-json php7.0-mbstring php7.0-mcrypt php7.0-mysql php7.0-opcache php7.0-pgsql php7.0-readline php7.0-soap php7.0-xml php7.0-zip php7.1 php7.1-bcmath php7.1-bz2 php7.1-cli php7.1-common php7.1-curl php7.1-gd php7.1-gmp php7.1-intl php7.1-json php7.1-mbstring php7.1-mcrypt php7.1-mysql php7.1-opcache php7.1-pgsql php7.1-readline php7.1-soap php7.1-xml php7.1-zip php7.2 php7.2-bcmath php7.2-cli php7.2-common php7.2-curl php7.2-gd php7.2-json php7.2-mbstring php7.2-mysql php7.2-opcache php7.2-readline php7.2-soap php7.2-xml php7.2-zip php7.3 php7.3-cli php7.3-common php7.3-curl php7.3-gd php7.3-intl php7.3-json php7.3-ldap php7.3-mbstring php7.3-mysql php7.3-opcache php7.3-readline php7.3-soap php7.3-xml php7.3-xmlrpc php7.3-zip php7.4 php7.4-cli php7.4-common php7.4-curl php7.4-gd php7.4-intl php7.4-json php7.4-ldap php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-readline php7.4-soap php7.4-sqlite3 php7.4-xml php7.4-xmlrpc php7.4-zip python python-httplib2 python-minimal python2 python2-minimal python3-httplib2 shotcut spotify-client xserver-xorg-video-amdgpu xserver-xorg-video-ati xserver-xorg-video-intel xserver-xorg-video-nouveau xserver-xorg-video-radeon yarn
2020-09-30 16:21:36,258 DEBUG Obsolete: gifski gitkraken ocenaudio oracle-java8-installer oracle-java8-set-default rambox screamingfrogseospider
2020-09-30 16:21:36,259 DEBUG updateSourcesList()
2020-09-30 16:21:36,278 DEBUG rewriteSourcesList() with mirror_check
2020-09-30 16:21:36,278 DEBUG ['ubuntu-minimal', 'ubuntu-standard']
2020-09-30 16:21:36,278 DEBUG Checking pkg: ubuntu-minimal
2020-09-30 16:21:36,286 DEBUG Checking pkg: ubuntu-standard
2020-09-30 16:21:36,292 DEBUG examining: 'deb http://archive.ubuntu.com/ubuntu bionic main restricted'
2020-09-30 16:21:36,292 DEBUG verifySourcesListEntry: deb http://archive.ubuntu.com/ubuntu focal main restricted
2020-09-30 16:21:36,292 DEBUG url_downloadable: http://archive.ubuntu.com/ubuntu/dists/focal/Release
2020-09-30 16:21:36,292 DEBUG s='http' n='archive.ubuntu.com' p='/ubuntu/dists/focal/Release' q='' f=''
2020-09-30 16:21:36,501 DEBUG entry 'deb http://archive.ubuntu.com/ubuntu focal main restricted' updated to new dist
2020-09-30 16:21:36,501 DEBUG examining: 'deb http://archive.ubuntu.com/ubuntu bionic-updates main restricted'
2020-09-30 16:21:36,502 DEBUG entry 'deb http://archive.ubuntu.com/ubuntu focal-updates main restricted' updated to new dist
2020-09-30 16:21:36,502 DEBUG examining: 'deb http://archive.ubuntu.com/ubuntu bionic universe'
2020-09-30 16:21:36,502 DEBUG entry 'deb http://archive.ubuntu.com/ubuntu focal universe' updated to new dist
2020-09-30 16:21:36,502 DEBUG examining: 'deb http://archive.ubuntu.com/ubuntu bionic-updates universe'
2020-09-30 16:21:36,503 DEBUG entry 'deb http://archive.ubuntu.com/ubuntu focal-updates universe' updated to new dist
2020-09-30 16:21:36,503 DEBUG examining: 'deb http://archive.ubuntu.com/ubuntu bionic multiverse'
2020-09-30 16:21:36,503 DEBUG entry 'deb http://archive.ubuntu.com/ubuntu focal multiverse' updated to new dist
2020-09-30 16:21:36,503 DEBUG examining: 'deb http://archive.ubuntu.com/ubuntu bionic-updates multiverse'
2020-09-30 16:21:36,503 DEBUG entry 'deb http://archive.ubuntu.com/ubuntu focal-updates multiverse' updated to new dist
2020-09-30 16:21:36,503 DEBUG examining: 'deb http://archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse'
2020-09-30 16:21:36,504 DEBUG entry 'deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse' updated to new dist
2020-09-30 16:21:36,504 DEBUG examining: 'deb http://archive.canonical.com/ubuntu bionic partner'
2020-09-30 16:21:36,504 DEBUG verifySourcesListEntry: deb http://archive.canonical.com/ubuntu focal partner
2020-09-30 16:21:36,504 DEBUG url_downloadable: http://archive.canonical.com/ubuntu/dists/focal/Release
2020-09-30 16:21:36,505 DEBUG s='http' n='archive.canonical.com' p='/ubuntu/dists/focal/Release' q='' f=''
2020-09-30 16:21:36,703 DEBUG entry 'deb http://archive.canonical.com/ubuntu focal partner' updated to new dist
2020-09-30 16:21:36,704 DEBUG examining: 'deb http://archive.ubuntu.com/ubuntu bionic-security main restricted'
2020-09-30 16:21:36,704 DEBUG entry 'deb http://archive.ubuntu.com/ubuntu focal-security main restricted' updated to new dist
2020-09-30 16:21:36,704 DEBUG examining: 'deb http://archive.ubuntu.com/ubuntu bionic-security universe'
2020-09-30 16:21:36,704 DEBUG entry 'deb http://archive.ubuntu.com/ubuntu focal-security universe' updated to new dist
2020-09-30 16:21:36,704 DEBUG examining: 'deb http://archive.ubuntu.com/ubuntu bionic-security multiverse'
2020-09-30 16:21:36,705 DEBUG entry 'deb http://archive.ubuntu.com/ubuntu focal-security multiverse' updated to new dist
2020-09-30 16:21:36,705 DEBUG examining: 'deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable'
2020-09-30 16:21:36,708 DEBUG entry '# deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable # disabled on upgrade to focal' was disabled (unknown mirror)
2020-09-30 16:21:36,708 DEBUG examining: 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'
2020-09-30 16:21:36,712 DEBUG entry '# deb https://dl.winehq.org/wine-builds/ubuntu/ focal main # disabled on upgrade to focal' was disabled (unknown mirror)
2020-09-30 16:21:36,712 DEBUG examining: 'deb http://ppa.launchpad.net/bablu-boy/nutty/ubuntu bionic main'
2020-09-30 16:21:36,715 DEBUG entry '# deb http://ppa.launchpad.net/bablu-boy/nutty/ubuntu focal main # disabled on upgrade to focal' was disabled (unknown mirror)
2020-09-30 16:21:36,716 DEBUG examining: 'deb http://ppa.launchpad.net/kritalime/ppa/ubuntu bionic main'
2020-09-30 16:21:36,719 DEBUG entry '# deb http://ppa.launchpad.net/kritalime/ppa/ubuntu focal main # disabled on upgrade to focal' was disabled (unknown mirror)
2020-09-30 16:21:36,719 DEBUG examining: 'deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main'
2020-09-30 16:21:36,722 DEBUG entry '# deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main # disabled on upgrade to focal' was disabled (unknown mirror)
2020-09-30 16:21:36,722 DEBUG examining: 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main'
2020-09-30 16:21:36,726 DEBUG entry '# deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main # disabled on upgrade to focal' was disabled (unknown mirror)
2020-09-30 16:21:36,726 DEBUG examining: 'deb http://ppa.launchpad.net/peek-developers/stable/ubuntu bionic main'
2020-09-30 16:21:36,729 DEBUG entry '# deb http://ppa.launchpad.net/peek-developers/stable/ubuntu focal main # disabled on upgrade to focal' was disabled (unknown mirror)
2020-09-30 16:21:36,729 DEBUG examining: 'deb http://repository.spotify.com stable non-free'
2020-09-30 16:21:36,732 DEBUG entry '# deb http://repository.spotify.com stable non-free # disabled on upgrade to focal' was disabled (unknown mirror)
2020-09-30 16:21:36,733 DEBUG examining: 'deb http://ppa.launchpad.net/haraldhv/shotcut/ubuntu bionic main'
2020-09-30 16:21:36,735 DEBUG entry '# deb http://ppa.launchpad.net/haraldhv/shotcut/ubuntu focal main # disabled on upgrade to focal' was disabled (unknown mirror)
2020-09-30 16:21:36,735 DEBUG examining: 'deb http://ppa.launchpad.net/audio-recorder/ppa/ubuntu bionic main'
2020-09-30 16:21:36,738 DEBUG entry '# deb http://ppa.launchpad.net/audio-recorder/ppa/ubuntu focal main # disabled on upgrade to focal' was disabled (unknown mirror)
2020-09-30 16:21:36,738 DEBUG examining: 'deb http://ppa.launchpad.net/phoerious/keepassxc/ubuntu bionic main'
2020-09-30 16:21:36,741 DEBUG entry '# deb http://ppa.launchpad.net/phoerious/keepassxc/ubuntu focal main # disabled on upgrade to focal' was disabled (unknown mirror)
2020-09-30 16:21:36,742 DEBUG examining: 'deb https://dl.yarnpkg.com/debian/ stable main'
2020-09-30 16:21:36,744 DEBUG entry '# deb https://dl.yarnpkg.com/debian/ stable main # disabled on upgrade to focal' was disabled (unknown mirror)
2020-09-30 16:21:36,744 DEBUG examining: 'deb http://ppa.launchpad.net/obsproject/obs-studio/ubuntu bionic main'
2020-09-30 16:21:36,746 DEBUG entry '# deb http://ppa.launchpad.net/obsproject/obs-studio/ubuntu focal main # disabled on upgrade to focal' was disabled (unknown mirror)
2020-09-30 16:21:36,746 DEBUG examining: 'deb http://ppa.launchpad.net/elementary-os/stable/ubuntu bionic main'
2020-09-30 16:21:36,748 DEBUG entry '# deb http://ppa.launchpad.net/elementary-os/stable/ubuntu focal main # disabled on upgrade to focal' was disabled (unknown mirror)
2020-09-30 16:21:36,748 DEBUG examining: 'deb http://ppa.launchpad.net/oibaf/graphics-drivers/ubuntu bionic main'
2020-09-30 16:21:36,750 DEBUG entry '# deb http://ppa.launchpad.net/oibaf/graphics-drivers/ubuntu focal main # disabled on upgrade to focal' was disabled (unknown mirror)
2020-09-30 16:21:39,530 DEBUG running doUpdate() (showErrors=True)
2020-09-30 16:21:58,296 DEBUG openCache()
2020-09-30 16:21:59,479 DEBUG Comparing 4.15.0-117 with 
2020-09-30 16:21:59,480 DEBUG Comparing 4.15.0-118 with 4.15.0-117
2020-09-30 16:21:59,700 DEBUG /openCache(), new cache size 66591
2020-09-30 16:21:59,700 DEBUG need_server_mode(): run in 'desktop' mode, (because of pkg 'ubuntu-desktop')
2020-09-30 16:21:59,701 DEBUG quirks: running PreDistUpgradeCache
2020-09-30 16:21:59,701 DEBUG running Quirks.PreDistUpgradeCache
2020-09-30 16:21:59,701 INFO installing python-is-python2 because python-minimal was installed
2020-09-30 16:21:59,701 DEBUG Installing 'python-is-python2' (python-minimal was installed on the system)
2020-09-30 16:21:59,765 INFO removing python-minimal because python-is-python2 is being installed
2020-09-30 16:21:59,766 DEBUG Removing 'python-minimal' (python-is-python2 is being installed on the system)
2020-09-30 16:21:59,845 INFO failed to remove python-minimal
2020-09-30 16:22:01,792 DEBUG Installing 'xserver-xorg-video-all' (Distro KeepInstalledPkgs rule)
2020-09-30 16:22:02,057 ERROR Dist-upgrade failed: 'E:Unable to correct problems, you have held broken packages.'
2020-09-30 16:22:02,058 DEBUG abort called
2020-09-30 16:22:02,060 DEBUG openCache()
2020-09-30 16:22:05,217 DEBUG Comparing 4.15.0-117 with 
2020-09-30 16:22:05,217 DEBUG Comparing 4.15.0-118 with 4.15.0-117
2020-09-30 16:22:05,498 DEBUG /openCache(), new cache size 100547

Trying to remove python-minimal results in the deletion of half my programs like emma, mysql workbench etc.

All packages are fully updated, all unnecessary packages removed, apt -f returns no errors.

Tried so far:

sudo apt --fix-broken install
sudo apt autoremove
sudo dpkg --get-selections | grep hold

All 3 commands return no errors or warnings.

How to proceed here?


Just used sudo apt-get purge python-minimal and after did regular upgrade.


The reason was one of the third party PPAs.

I installed ppa-purge and aptitude:

sudo apt-get install ppa-purge aptitude

I executed a few ppa-purge commands for 3rd party PPAs (CAREFUL: This commands removes all packages from the given PPAs):

sudo ppa-purge ppa:audio-recorder/ppa
sudo ppa-purge ppa:bablu-boy/nutty
sudo ppa-purge ppa:elementary-os/stable
sudo ppa-purge ppa:haraldhv/shotcut
sudo ppa-purge ppa:kritalime/ppa
sudo ppa-purge ppa:obsproject/obs-studio
sudo ppa-purge ppa:oibaf/graphics-drivers

And restarted the upgrade. Then it worked. So one of them must have blocked it.

sudo do-release-upgrade

I also experienced problems while doing this update. Thankfully, the error messages were helpful. If you see the part about unofficial software installed, then take a look at files mentioned in the message below:

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'.

Problematic packages are named in one of these. Try uninstalling mentioned packages and doing distro upgrade again. In my case sudo apt-get remove postgresql-10-postgis-2.4 ; sudo apt-get remove ; sudo apt-get autoremove was enough to continue with the upgrade.