I had to uninstall GDB just to upgrade to 17.10, but now I can't get it installed again.

sudo apt install gdb
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 gdb : Depends: libpython3.6 (>= 3.6.0~b2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

So I went down the dependency chain:

The following packages have unmet dependencies:
 libpython3.6 : Depends: libpython3.6-stdlib (= 3.6.3-1ubuntu1) but 3.6.3-1+xenial2 is to be installed
E: Unable to correct problems, you have held broken packages.

Why is there a reference to Xenial? And why can't it be upgraded?

It seems that GDB requires a specific version, that doesn't match the xenial one. Attempting to remove the package is nigh impossible because of the number of packages which depend on libpython3.6.

Further information:

apt-cache showpkg
Package: libpython3.6
3.6.3-1ubuntu1 (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_artful_main_binary-amd64_Packages)

apt-cache showpkg
Package: python3.6
3.6.3-1+xenial2 (/var/lib/dpkg/status)
3.6.3-1ubuntu1 (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_artful_main_binary-amd64_Packages)

So my guess is that APT doesn't have a handle on where it got the +xenial2 package from.

  • 1
    Do you have any PPAs or other non-standard repositories enabled? – steeldriver Oct 26 '17 at 15:10
  • @steeldriver I think it may have been related to PPAs, but I'm not sure why a xenial package would be considered more up-to-date than the Ubuntu one... – Robobenklein Oct 26 '17 at 22:04

On clean 17.10 installation gdb installs without problems.

You may have PPA.

Please check output of

  • ls -al /etc/apt/sources.list.d/*.list (list PPAs sources.lists),
  • aptitude search '?narrow(?installed, ~Oppa)' (list of packages, installed from PPAs),
  • aptitude search '?narrow(?installed, ~o)' (list of obsolete packages) - see this answer for reference.

Also you can check solution from "How do I resolve unmet dependencies after adding a PPA?".

UPDATE: it seems that you simply have python3.6 from deadsnakes team's PPA:
see http://ppa.launchpad.net/deadsnakes/ppa/ubuntu/pool/main/p/python3.6/ (check it for 3.6.3-1+xenial2 versions).

  • I tried checking the source of libpython3.6 and python3.6 but they don't come from that PPA. I checked the apt sources (added some info to the Question) but they appear to come from the main repo. (Could be an error since the PPAs are disabled on upgrade.) The obsolete command helped me figure out a few things. I think I found the answer involving downgrading the packages, but how would I have gotten the +xenial2 versions if I never added that ppa? Could it have come from somewhere else? – Robobenklein Oct 26 '17 at 22:03
  • And on another note, why does GDB's dependency on libpython3.6 (>= 3.6.0~b2) not match the xenial version even though it's 3.6.3? – Robobenklein Oct 26 '17 at 22:08

The issue here is that the package version 3.6.3-1+xenial2 was considered newer than 3.6.3-1ubuntu1.

The fix was to downgrade the package, even though the actual python version was the same.

This was a weird issue to fix because I hadn't used any PPAs which N0rbert suggested, and the package was considered newer than the main repos one (although it wasn't).

This may have been because I had first installed this system on Xenial, which might have had something to do with why I had that strange version installed. (Potentially a backport with different naming scheme?)

On downgrading packages: How to downgrade a package via apt-get?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.