Comment 4 for bug 1313958

Michael Schaller (misch-9) wrote :

Error during dist-upgrade from Precise to Trusty:
Unpacking libltdl-dev:i386 (2.4.2-1.7ubuntu1) over (2.4.2-1ubuntu1) ...
Preparing to unpack .../libltdl-dev_2.4.2-1.7ubuntu1_amd64.deb ...
Unpacking libltdl-dev:amd64 (2.4.2-1.7ubuntu1) over (2.4.2-1ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/libltdl-dev_2.4.2-1.7ubuntu1_amd64.deb (--unpack):
 trying to overwrite shared '/usr/share/libtool/libltdl/Makefile.in', which is different from other instances of package libltdl-dev:amd64

dpkg status afterwards: (one of the two package is only in state unpacked)
$ dpkg -l | grep libltdl-dev
ii libltdl-dev:amd64 2.4.2-1ubuntu1 amd64 A system independent dlopen wrapper for GNU libtool
iU libltdl-dev:i386 2.4.2-1.7ubuntu1 i386 A system independent dlopen wrapper for GNU libtool

Trying to unpack the other package fails with the same error:
$ sudo dpkg --unpack /var/cache/apt/archives/libltdl-dev_2.4.2-1.7ubuntu1_amd64.deb
(Reading database ... 198056 files and directories currently installed.)
Preparing to unpack .../libltdl-dev_2.4.2-1.7ubuntu1_amd64.deb ...
Unpacking libltdl-dev:amd64 (2.4.2-1.7ubuntu1) over (2.4.2-1ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/libltdl-dev_2.4.2-1.7ubuntu1_amd64.deb (--unpack):
 trying to overwrite shared '/usr/share/libtool/libltdl/Makefile.in', which is different from other instances of package libltdl-dev:amd64
Errors were encountered while processing:
 /var/cache/apt/archives/libltdl-dev_2.4.2-1.7ubuntu1_amd64.deb

Difference between the two '/usr/share/libtool/libltdl/Makefile.in' files:
$ dpkg-deb --extract /var/cache/apt/archives/libltdl-dev_2.4.2-1.7ubuntu1_amd64.deb /tmp/libltdl-dev:amd64
$ dpkg-deb --extract /var/cache/apt/archives/libltdl-dev_2.4.2-1.7ubuntu1_i386.deb /tmp/libltdl-dev:i386
$ diff /tmp/libltdl-dev:amd64/usr/share/libtool/libltdl/Makefile.in /tmp/libltdl-dev:i386/usr/share/libtool/libltdl/Makefile.in
90c90
< $(srcdir)/config-h.in lt__dirent.c lt__strl.c argz.c \
---
> $(srcdir)/config-h.in argz.c lt__strl.c lt__dirent.c \

I had a look on the source package of libtool. I ran the bootstrap script in the source twice and was able to reproduce the issue. It appears that there is no stable order in use when the libltdl/Makefile.in will be generated.