6

When I do sudo do-release-upgrade to update to the next LTS, I get

Could not calculate the upgrade

An unresolvable problem occurred while calculating the upgrade.

The cause seems to be this (from /var/log/dist-upgrade/main.log):

WARNING Can't mark 'ubuntu-desktop' for upgrade (E:Unable to correct problems, you have held broken packages.)
ERROR Dist-upgrade failed: 'Broken packages after upgrade: ubuntu-desktop'

How do I resolve this problem? /var/log/dist-upgrade/apt.log displays too many broken packages, and I am lost on how to proceed. I know I should not delete ubuntu-desktop, what should I do?

Note, I did sudo apt update and sudo apt upgrade. Nothing reports broken packages other than do-release-upgrade. I do not think I have broken package in current version, it seems more like upgrading would cause some broken links.

Abastro
  • 101

2 Answers2

0

I had a very similar if not identical problem but in conjunction with Lubuntu 22.04 and not Ubuntu 22.04.

So in my case the lubuntu-desktop package caused the problems. It looks that the upgrade process to 24.04 is failing sometimes when multiple desktop environments are / were present on the system. I have converted a former Kubuntu 20.04 installation to Lubuntu 20.04 and then upgraded to 22.04. So probably that was the reason for my troubles with further upgrading to 24.04.

However, the effective solution was indeed the removal of the lubuntu-desktop package. Just boot up the system to the CLI by adding a number 3 to the start parameters (in GRUB) and login with your username and password. After that remove the desktop package, for me this was:

sudo apt remove lubuntu-desktop

Or, in the case mentioned here for Ubuntu this would be:

sudo apt remove ubuntu-desktop

Note, do not purge it because this would also remove all the config files.

After that I was able to launch the upgrade process to 24.04.

sudo do-release-upgrade

When finished reboot the system as requested. Because no desktop is installed Ubuntu should start automatically to the CLI. Otherwise boot again to the CLI by adding a number 3 to the boot parameters. Then reinstall the preferred desktop environment again. In my case this was:

sudo apt --reinstall install lubuntu-desktop

Or, for normal Ubuntu:

sudo apt --reinstall install ubuntu-desktop

Final note, - all the other "broken" packages reported in main.log or apt.log had no relevance in my case. So don't waste your time by reinstalling them. If the upgrade process fails because of a desktop related package then just focus on that one. ;-)

Clemens
  • 541
0

I had a lot of Gnome Tweak packages installed on my OS, which prevented me from updating the OS version. So I suggest you remove any such tweaks before updating the OS.