Debian multiarch: Unexpected complication when building amd64 packages: Can’t install!

This is a multiarch issue I had not considered before. Have you seen it? I never wanted to be a "cross compiler", I really only want to build amd64. But I have some i386 libraries for a particular program (acroread).

I've just learned that, if I build amd64 packages, I can't install them for testing because I've not also built the i386 packages. I built the packages, watch their install 1) proceed, 2) fail to finish (leaving system in very inconsistent state)

pauljohn@pols-124:cairo-1.12.10$ sudo dpkg -i libcairo2_1.12.10-1_amd64.deb (Reading database ... 311111 files and directories currently installed.)
Preparing to replace libcairo2:amd64 1.12.10-1 (using libcairo2_1.12.10-1_amd64.deb) ...
Unpacking replacement libcairo2:amd64 ...
dpkg: error processing libcairo2:amd64 (--install):
package libcairo2:amd64 1.12.10-1 cannot be configured because libcairo2:i386 is at a different version (1.12.2-2)
Errors were encountered while processing:
libcairo2:amd64

That's really inconvenient! I don't understand why there has to be a linkage between the shared library versions on amd64 and i386. Aren't they separate?

You ask "why cairo?" I am curious to know if a new libcairo2 fixes a little bug in Evince (invisible vertical quotes: https://bugs.freedesktop.org/show_bug.cgi?id=59636#c4). So I worked through the packaging for cairo-1.12.10. dpkg-buildpackage -rfakeroot gives me the goods (after fiddling some patch fuzz):

cairo-perf-utils_1.12.10-1_amd64.deb
libcairo2_1.12.10-1_amd64.deb
libcairo2-dbg_1.12.10-1_amd64.deb
libcairo2-dev_1.12.10-1_amd64.deb
libcairo2-doc_1.12.10-1_all.deb
libcairo2-udeb_1.12.10-1_amd64.udeb
libcairo-gobject2_1.12.10-1_amd64.deb
libcairo-script-interpreter2_1.12.10-1_amd64.deb

I expect your answer will be "yes, it really is that hard, you have to learn how to compile for i386 too". I'm trying (http://wiki.debian.org/Multiarch/HOWTO), but not making progress. I'm like a collection of monkies trying to type the Bible at random, I'm afraid.

pauljohn@pols-124:~$ sudo apt-get build-dep -a i386 libcairo2
[sudo] password for pauljohn:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Picking 'cairo' as source package instead of 'libcairo2'
The following packages have unmet dependencies:
libfontconfig1-dev:i386 : Depends: libfreetype6-dev:i386 (>= 2.1.7) but it is not going to be installed
E: Build-dependencies for libcairo2 could not be satisfied.

pauljohn@pols-124:~$ sudo apt-get install libfontconfig1-dev:i386
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
libcairo2 : Breaks: libcairo2:i386 (!= 1.12.10-1) but 1.12.2-2 is to be installed
libcairo2:i386 : Breaks: libcairo2 (!= 1.12.2-2) but 1.12.10-1 is to be installed
libfontconfig1-dev : Conflicts: libfontconfig1-dev:i386 but 2.9.0-7.1 is to be installed
libfontconfig1-dev:i386 : Depends: libexpat1-dev:i386 but it is not going to be installed
Depends: libfreetype6-dev:i386 (>= 2.1.7) but it is not going to be installed
Depends: pkg-config:i386 but it is not going to be installed
Conflicts: libfontconfig1-dev but 2.9.0-7.1 is to be installed
E: Unmet dependencies. Try 'apt-get -f inst

And I stop there, seeing that the failed install of the amd64 packages has now broken everything. I need to back-track to find a way to fix that and then hide in the safety of Wheezy.

About pauljohn

Paul E. Johnson is a Professor of Political Science at the University of Kansas. He is an avid Linux User, an adequate system administrator and C programmer, and humility is one of his greatest strengths.
This entry was posted in Linux and tagged , , . Bookmark the permalink.