Ubuntu – Does the installation of a 32-bit package remove 64-bit packages

14.0432-bit64-bitpackage-management

It's not clear to me why the installation of a 32-bit package would necessitate the removal of a 64-bit package.

For example, if I try to install the 32-bit development package of libcurl
apt-get indicates it will remove several 64-bit packages, including gcc!

$ sudo apt-get install libcurl4-openssl-dev:i386
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  g++-4.8 gcc-4.8 libasan0 libasan0:i386 libatomic1 libatomic1:i386 libc6-dev
  libcloog-isl4:i386 libgcc-4.8-dev libgcc-4.8-dev:i386 libgmp10:i386 libgomp1
  libgomp1:i386 libisl10:i386 libitm1 libitm1:i386 libmpc3:i386 libmpfr4:i386
  libquadmath0 libquadmath0:i386 libstdc++-4.8-dev libtsan0 linux-libc-dev
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  comerr-dev:i386 gcc-4.8-base:i386 gcc-4.9-base:i386 krb5-multidev:i386
  libasn1-8-heimdal:i386 libc6:i386 libc6-dev:i386 libcomerr2:i386
  libcurl3:i386 libdb5.3:i386 libffi6:i386 libgcc1:i386 libgcrypt11:i386
  libgcrypt11-dev:i386 libgnutls-dev:i386 libgnutls-openssl27:i386
  libgnutls26:i386 libgnutlsxx27:i386 libgpg-error-dev:i386 libgpg-error0:i386
  libgssapi-krb5-2:i386 libgssapi3-heimdal:i386 libgssrpc4:i386
  libhcrypto4-heimdal:i386 libheimbase1-heimdal:i386 libheimntlm0-heimdal:i386
  libhx509-5-heimdal:i386 libidn11:i386 libidn11-dev:i386 libk5crypto3:i386
  libkadm5clnt-mit9:i386 libkadm5srv-mit9:i386 libkdb5-7:i386
  libkeyutils1:i386 libkrb5-26-heimdal:i386 libkrb5-3:i386 libkrb5-dev:i386
  libkrb5support0:i386 libldap-2.4-2 libldap-2.4-2:i386 libldap2-dev:i386
  libp11-kit-dev:i386 libp11-kit0:i386 libroken18-heimdal:i386
  librtmp-dev:i386 librtmp0:i386 libsasl2-2:i386 libsasl2-modules:i386
  libsasl2-modules-db:i386 libsqlite3-0:i386 libssl-dev:i386 libssl1.0.0:i386
  libstdc++6:i386 libtasn1-6:i386 libtasn1-6-dev:i386 libwind0-heimdal:i386
  linux-libc-dev:i386 pkg-config zlib1g:i386 zlib1g-dev:i386
Suggested packages:
  doc-base:i386 krb5-doc:i386 glibc-doc:i386 locales:i386 manpages-dev:i386
  libcurl4-doc:i386 libcurl3-dbg:i386 rng-tools:i386 libgcrypt11-doc:i386
  gnutls26-doc:i386 gnutls-bin:i386 krb5-user:i386 libsasl2-modules-otp:i386
  libsasl2-modules-ldap:i386 libsasl2-modules-sql:i386
  libsasl2-modules-gssapi-mit:i386 libsasl2-modules-gssapi-heimdal:i386
Recommended packages:
  gcc:i386 c-compiler:i386 libssl-doc:i386
The following packages will be REMOVED:
  cpp g++ gcc
The following NEW packages will be installed:
  comerr-dev:i386 gcc-4.8-base:i386 gcc-4.9-base:i386 krb5-multidev:i386
  libasn1-8-heimdal:i386 libc6:i386 libc6-dev:i386 libcomerr2:i386
  libcurl3:i386 libcurl4-openssl-dev:i386 libdb5.3:i386 libffi6:i386
  libgcc1:i386 libgcrypt11:i386 libgcrypt11-dev:i386 libgnutls-dev:i386
  libgnutls-openssl27:i386 libgnutls26:i386 libgnutlsxx27:i386
  libgpg-error-dev:i386 libgpg-error0:i386 libgssapi-krb5-2:i386
  libgssapi3-heimdal:i386 libgssrpc4:i386 libhcrypto4-heimdal:i386
  libheimbase1-heimdal:i386 libheimntlm0-heimdal:i386 libhx509-5-heimdal:i386
  libidn11:i386 libidn11-dev:i386 libk5crypto3:i386 libkadm5clnt-mit9:i386
  libkadm5srv-mit9:i386 libkdb5-7:i386 libkeyutils1:i386
  libkrb5-26-heimdal:i386 libkrb5-3:i386 libkrb5-dev:i386 libkrb5support0:i386
  libldap-2.4-2:i386 libldap2-dev:i386 libp11-kit-dev:i386 libp11-kit0:i386
  libroken18-heimdal:i386 librtmp-dev:i386 librtmp0:i386 libsasl2-2:i386
  libsasl2-modules:i386 libsasl2-modules-db:i386 libsqlite3-0:i386
  libssl-dev:i386 libssl1.0.0:i386 libstdc++6:i386 libtasn1-6:i386
  libtasn1-6-dev:i386 libwind0-heimdal:i386 linux-libc-dev:i386 pkg-config
  zlib1g:i386 zlib1g-dev:i386
The following packages will be upgraded:
  libldap-2.4-2
1 upgraded, 60 newly installed, 3 to remove and 28 not upgraded.
Need to get 15.1 MB of archives.
After this operation, 54.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.

Multiarch support appears to be enabled:

$ dpkg --print-foreign-architectures
i386

I need to utilise both 64-bit and 32-bit packages on the same development box. I believe this should be trivial. What am I misunderstanding? What do I need to do to install 32-bit packages without removing critical 64-bit packages?

Best Answer

  • Don't install 32-bit *-dev packages. dev are almost always just header files. And the header files are almost always the same for all architectures.

    Just install 32-bit libraries. In this particular case it is libcurl3.