Could not calculate the upgrade, what happened?

Solution 1:

What worked for me was removing any broken packages, as they were preventing the upgrade.

First find out which packages are broken:

grep Broken /var/log/dist-upgrade/apt.log

Then remove them:

sudo apt-get remove <packages to remove>

Some might be reinstalled during the upgrade, others you may have to reinstall yourself.

Solution 2:

After your system fails to upgrade, check the file /var/log/dist-upgrade/main.log

I found the line:

2013-10-17 15:00:30,543 ERROR Dist-upgrade failed: 'The package 'xubuntu-desktop' is marked for removal but it is in the removal blacklist.'

I manually removed xubuntu-desktop. The upgrade then continued without issue.

Solution 3:

Similar issue here. Last few lines in the "main.log" file indicated in the previous post were:

2013-10-17 23:44:38,233 DEBUG blacklist expr 'unity$' matches 'unity'
2013-10-17 23:44:38,233 DEBUG The package 'unity' is marked for removal but it's in the removal blacklist
2013-10-17 23:44:43,585 ERROR Dist-upgrade failed: 'The package 'unity' is marked for removal but it is in the removal blacklist.'
2013-10-17 23:44:43,586 DEBUG abort called
2013-10-17 23:44:43,592 DEBUG openCache()
2013-10-17 23:44:43,592 DEBUG failed to SystemUnLock() (E:Not locked) 
2013-10-17 23:44:46,786 DEBUG /openCache(), new cache size 41453
2013-10-17 23:44:46,786 DEBUG enabling apt cron job

Manually de-installed unity and upgrade now proceeds. Not quite sure what causes this issue in the first place and whether this is truly a good "solution" but I guess I'll find out after the update is completed?!?