Remove Unofficial Packages for a Smooth Upgrade to Ubuntu 24.04 LTS

The upgrade from Ubuntu 22.04 to 24.04 took a lot more effort than I am used to. The option to install to the current LTS version did not show up in the graphical update application and the command line tool ended with this error:

Checking package manager
Reading package lists… Done
Building dependency tree… Done
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… Done
Reading state information… Done

The installer could not find some packages and quit before it did any work. The log file did not help me much; it just repeated the error message without mentioning the name of the problematic packages. I had to figure out that on my own.

Inside the file /etc/apt/sources.list and in the directory /etc/apt/sources.list.d/ we can find the package sources of our system. With the help of the following command I could check which packages I installed from a specific package source:

5 deadsnakes/ppa/ubuntu libpython3.12-minimal
5 team-xbmc/ppa/ubuntu kodi

I worked my way through the list of package sources and got lucky after a few tries. When I removed kodi and the libpython package, the upgrade tool finally could do its job and installed Ubuntu 24.04 without further problems.

So far, Ubuntu 24.04 works as expected. I only noticed a problem with a Java application that I address in next week’s post.

1 thought on “Remove Unofficial Packages for a Smooth Upgrade to Ubuntu 24.04 LTS”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.