9

I'm trying to upgrade my system from 18.04 to 20.04 using update-manager. No matter what I seem to try, I get an error while calculating the upgrade:

Could not calculate the upgrade

An unresolvable problem occurred while calculating the upgrade.

At first, the error gave me a reason: I had to purge all Launchpad PPAs. I did that, and after still receiving the same error, I did some searching and found this bug report where some users said installing clang-9 solved this issue. I did so myself, and now I get the same error with a different explanation: I've "installed a prerelease version. This is a transient issue." So I removed clang-9, updated and autoremoved everything, and now I just get the error without any suggested explanation at all.

Since this dialogue isn't helping, I trekked on over to my /var/log/dist-upgrade/main.log, where I saw this line:

ERROR Dist-upgrade failed: 'E:Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.'

I then checked apt.log to see what was going on. There is clearly quite a bit going wrong.

What are my options from here? If you grep this log for "Broken," there are quite a few packages that the upgrader views as broken (though none of them show up with dpkg or in Synaptic), and removing all of them is unfeasible and I worry may break my whole system. Based on the list of problem packages, I'm thinking there exists a key package or two that fixing will eliminate the whole issue. I am just not sure which ones they might be. Any help would be greatly appreciated.

Mitch
  • 107,631
Jakester897
  • 93
  • 1
  • 4

2 Answers2

9

The python-dev package is blocking the intended upgrade from 18.04 to 20.04. This package has been discontinued in 20.04 because Python 2.x is no longer being maintained. Open the terminal and type:

sudo apt remove python-dev python-is-python2 
sudo apt autoremove  

gnuradio-dev depends on python-dev, so run the following command to uninstall it.

sudo apt remove gnuradio-dev

After you have removed python-dev and gnuradio-dev you may be able to upgrade from 18.04 to 20.04 with do-release-upgrade -d without getting an E:Error, pkgProblemResolver::Resolve generated breaks error message. If not see the answers to E:Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

If that doesn't work do as follows:

sudo apt install ppa-purge aptitude
cat /etc/apt/sources.list

Run sudo ppa-purge ppa-name to uninstall all the packages from the PPAs in your software sources. Then run sudo apt update and try to upgrade from 18.04 to 20.04 with do-release-upgrade -d.

If you try to release upgrade from the terminal and fail, you will get an error message pointing to the location of the log file where the information about which package caused the error message is stored. If not too many other packages depend on whatever package is blocking the release upgrade, you can safely uninstall it and reinstall it after the release upgrade is finished.

karel
  • 114,770
  • Thanks. Removing those two packages worked. – Jakester897 Oct 06 '20 at 18:53
  • 1
    For me sudo apt remove python-dev did suffice. I would however recommend to do an sudo apt autoremove afterwards to clean up unneeded packages. – Robert Oct 18 '20 at 18:16
  • @Robert That's a good suggestion. – karel Oct 18 '20 at 18:24
  • I've the same problem but it's hard to understand what is the package affecting the error. main.log says something related with python but all python2 stuffs already removed continuing to list python removed packages :( – Luigi Pirelli Nov 17 '20 at 15:00
  • @LuigiPirelli If you at least try to release upgrade from the terminal and fail, you will get an error message pointing to the location of the log file where the information about which package caused the error message is stored. If not too many other packages depend on whatever package is blocking the release upgrade, you can safely uninstall it and reinstall it after the release upgrade is finished. – karel Nov 17 '20 at 15:05
  • @karel a problem is that main.log and apt.log are (for me at least) unclear to point what is the error... a lot of debug messages +this las ones: 2020-11-17 16:24:13,507 INFO checking for python-minimal 2020-11-17 16:24:13,507 INFO checking for python-dev 2020-11-17 16:24:13,507 INFO checking for libpython-dev 2020-11-17 16:24:13,507 INFO checking for libpython-stdlib 2020-11-17 16:24:13,507 INFO checking for libpython-dbg 2020-11-17 16:24:14,090 ERROR Dist-upgrade failed: 'E:Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.' – Luigi Pirelli Nov 17 '20 at 15:50
  • None of that packages are installed (I removed). In screenlog no package name is listed point to the offending pakage :/ any suggestion? – Luigi Pirelli Nov 17 '20 at 15:50
  • @LuigiPirelli For me the offending packages were python-dev and libpython-dev. You can simulate removing them with apt remove --simulate python-dev libpython-dev (no sudo because it's just a simulation) and check if it would break anything important to remove them. – karel Nov 17 '20 at 16:01
  • @keral one problem is that I already uninstalled python-dev libpython-dev (and more) but do-release-upgrade continue to list it in the log (also after reboot)... No idea how to follow! btw thank you for your support – Luigi Pirelli Nov 18 '20 at 09:49
  • @LuigiPirelli This command will get rid of the rest of it even if the packages have already been uninstalled: sudo apt purge python-dev libpython-dev (and more like you wrote in the preceding comment). – karel Nov 18 '20 at 10:04
1

I had to uninstall

apt remove python2.7-minimal

and unfortunately all its dependencies.

krissy
  • 11