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? Oct 26, 2017 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... Oct 26, 2017 at 22:04

3 Answers 3


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? Oct 26, 2017 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? Oct 26, 2017 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?


Try this to fix it :

sudo apt install python 


sudo apt install python2

Then :

sudo apt install pip

Type the following commands in your terminal to install gdebi :

sudo add-apt-repository universe

then :

sudo apt-get update

then install gdebi core :

sudo apt-get install gdebi-core

You need to install the gdebi package if you want GDebi GUI, which mean the app, which is easier to use.

sudo apt-get install gdebi

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .