I am trying to build Code::Blocks IDE on Ubuntu 16.04 using this recipe:

https://code.launchpad.net/~damien-moore/+recipe/codeblocks-16.01-release

It needs libwxgtk2.8-dev, which isn't in the 16.04 repos but I've added to the package here:

https://launchpad.net/~damien-moore/+archive/ubuntu/codeblocks-stable/+packages

But when I build, I keep getting an unmet dependency error:

https://code.launchpad.net/~damien-moore/+archive/ubuntu/codeblocks-stable/+recipebuild/1126247

You can see the control file here:

http://bazaar.launchpad.net/~damien-moore/+junk/codeblocks-16.01-release/view/head:/debian/control

Any ideas what I'm doing wrong?

  • I dont know where youre looking but for me libwxgtk2.8-0 and libwxgtk2.8-dev are in the 16.04 repos. Aswell there is libwxgtk 3.0 on which you could build Code::Blocks aswell against. – Videonauth Apr 27 '16 at 13:42
  • Maybe they just added them back in? 3.0 is no good for this, because the current release version of C::B (which the repo is intended to contain) becomes unstable. – dlm Apr 27 '16 at 13:50
  • Well i know what you speak of since C::B is only as 13.02 in the repos i have build it myself to. – Videonauth Apr 27 '16 at 13:51
  • Yes, we didn't release in time to get it into 16.04. Anyway, it looks like wx2.8 is gone from the main repos packages.ubuntu.com/xenial/allpackages. I think they pulled it. It still leaves me with the quandary of why the build system doesn't find the wx2.8 packages I put in the PPA. – dlm Apr 27 '16 at 13:55
up vote 1 down vote accepted

The error messages you get from apt in this kind of situation are slightly misleading: it's in fact telling you that the libwxgtk2.8-dev package is present but uninstallable. You can get better diagnostics by setting up an environment where apt has your PPA in its sources.list (the chdist tool can be helpful here to avoid disturbing your normal environment or bothering with a full chroot or similar) and drilling down interactively:

$ chdist create codeblocks
Now edit /home/cjwatson/.chdist/codeblocks/etc/apt/sources.list
Run chdist apt-get codeblocks update
And enjoy.
$ cat >.chdist/codeblocks/etc/apt/sources.list <<EOF
deb [trusted=yes] http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu xenial main
deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse
EOF
$ chdist apt-get codeblocks update
# ignore GPG errors in the output, which don't matter for the purposes of
# inspection
$ chdist apt-get codeblocks install libwxgtk2.8-dev
Reading package lists... Done
Building dependency tree... 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.
 libwxgtk2.8-dev : Depends: libwxgtk2.8-0 (= 2.8.12.1+dfsg2-0~48~ubuntu16.04.1) but it is not going to be installed
                   Depends: libwxbase2.8-dev (= 2.8.12.1+dfsg2-0~48~ubuntu16.04.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Then you add package names to the command line until you get a more specific message than "is not going to be installed":

$ chdist apt-get codeblocks install libwxgtk2.8-dev libwxgtk2.8-0 libwxbase2.8-dev libwxbase2.8-0
Reading package lists... Done
Building dependency tree... 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.
 libwxbase2.8-0 : Depends: libwxbase2.8-0 (>= 2.8.12.1+dfsg2) but 2.8.12.1+dfsg2-0~48~ubuntu16.04.1 is to be installed
 libwxgtk2.8-0 : Depends: libwxbase2.8-0 (>= 2.8.12.1+dfsg2) but 2.8.12.1+dfsg2-0~48~ubuntu16.04.1 is to be installed
                 Depends: libwxgtk2.8-0 (>= 2.8.12.1+dfsg2) but 2.8.12.1+dfsg2-0~48~ubuntu16.04.1 is to be installed
E: Unable to correct problems, you have held broken packages.
$ dpkg --compare-versions 2.8.12.1+dfsg2-0~48~ubuntu16.04.1 gt 2.8.12.1+dfsg2 && echo yes || echo no
no

So, translating to English, the wx packages in your PPA have internal dependencies on at least 2.8.12.1+dfsg2, but the version you've used for your forward-port to xenial in your PPA is 2.8.12.1+dfsg2-0~48~ubuntu16.04.1 which is (subtly) in fact slightly less than the required version. You would have to fix the version number, or (more intrusively) adjust the dependencies to be more liberal.

Why not simply copy the source and built binary packages from wily, though? While they've been removed from xenial, they're apparently still installable if just directly copied forward, and that would be by far the least-effort option. Grab lp:ubuntu-archive-tools with bzr and run:

$ ./copy-package --from ubuntu --from-suite wily --to ppa:damien-moore/ubuntu/codeblocks-stable --to-suite xenial -b wxwidgets2.8

Then wait a bit for that to copy and publish, and all should be well. Failing that, I would recommend basing your wxwidgets2.8 source package on the one in wily (2.8.12.1+dfsg2-2ubuntu2) and making sure the version number you use compares greater than or equal to that.

As a side note, your build should actually have been recorded by Launchpad as a build failure rather than a dependency wait, because we can't produce an unambiguous dependency wait in the case of a build-dependency that is present but uninstallable. I've filed this as bug 1575965.

  • Many thanks. Tremendously informative and shows how much I have to learn :/ (I ended up resolving by changing the version number, but the copy-package is clearly the better fix.) – dlm Apr 28 '16 at 2:36

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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