Ubuntu – How do you run a 32-bit program on a 64-bit version of Ubuntu

32-bit64-bitpackage-managementsoftware installation

I have a 64-bit version of Ubuntu 13.10. I want to run a 32-bit version of a program. However I see ia32-libs is not included in 13.10. Is there a replacement package for this or what?

Best Answer

  • There isn't need of the ia32-libs package anymore (since 12.04 to be exact), if you use the APT system, you have nothing to worry about installing 32-bit packages in a 64-bit system. This happened since the introduction of multiarch, one of the Debian most game changing policies in the way Debian manages it dependencies. This method allows to have different binary targets in the same system without care of the kernel architecture. This doesn't mean that you can run any 32-bit package without preparation, but if you install the libraries/binaries any applications in theory should be able to run. This is true from 64-bit to 32-bit and vice-versa.

    enter image description here

    For using such method is recommended using the APT managers, to prevent unmet dependencies. The changelog includes a small history about how the changes were made:

    1. In precise the package was emptied and made a transitional package. It was added several dependencies against packages that hasn't been moved to multiarch.
    2. Slowly but surely, all packages were rebuild with multiarch support and the reverse dependencies were being dropped or changed to ia32-lib-multiarch. When theses packages stop needing the ia34-libs packages the dependencies were dropped at the same time. The dependencies were changed from ia32-libs to package:arch being package the name of the library needed and arch the architecture (below there is a example with skype).
    3. With the last release the ia32-libs-multiarch package was removed from pre-raring releases and ia32-libs don't got published to saucy. All Ubuntu packages are multiarch capable and you can install different architecture packages in your system.

    Now, when installing a package that needs 32-bit binaries, if you don't pay attention you will never know that you are using a 32-bit package, since the package manager will pull automatically the necessary dependencies:

    sudo apt-get --no-install-recommends -q -y install skype
    Reading package lists...
    Building dependency tree...
    Reading state information...
    The following extra packages will be installed:
      libaudio2:i386 libjbig0:i386 liblcms1:i386 libmng1:i386 libqt4-dbus:i386 libqt4-declarative:i386
      libqt4-network:i386 libqt4-opengl:i386 libqt4-script:i386 libqt4-sql:i386 libqt4-xml:i386
      libqt4-xmlpatterns:i386 libqtcore4:i386 libqtgui4:i386 libqtwebkit4:i386 libssl1.0.0:i386 libtiff5:i386
      libxss1:i386 libxv1:i386 skype-bin:i386
    Suggested packages:
      nas:i386 liblcms-utils:i386 libqt4-declarative-folderlistmodel:i386 libqt4-declarative-gestures:i386
      libqt4-declarative-particles:i386 libqt4-declarative-shaders:i386 qt4-qmlviewer:i386 libqt4-dev:i386
      libthai0:i386 libicu48:i386 qt4-qtconfig:i386
    Recommended packages:
      libqt4-sql-mysql:i386 libqt4-sql-odbc:i386 libqt4-sql-psql:i386 libqt4-sql-sqlite:i386 libcups2:i386
      sni-qt:i386 libasound2-plugins:i386
    The following NEW packages will be installed:
      libaudio2:i386 libjbig0:i386 liblcms1:i386 libmng1:i386 libqt4-dbus:i386 libqt4-declarative:i386
      libqt4-network:i386 libqt4-opengl:i386 libqt4-script:i386 libqt4-sql:i386 libqt4-xml:i386
      libqt4-xmlpatterns:i386 libqtcore4:i386 libqtgui4:i386 libqtwebkit4:i386 libssl1.0.0:i386 libtiff5:i386
      libxss1:i386 libxv1:i386 skype skype-bin:i386
    0 upgraded, 21 newly installed, 0 to remove and 0 not upgraded.
    Need to get 33.9 MB/38.2 MB of archives.
    After this operation, 118 MB of additional disk space will be used.
    Preconfiguring packages ...
    Selecting previously unselected package libssl1.0.0:i386.
    (Reading database ... 208485 files and directories currently installed.)
    Unpacking libssl1.0.0:i386 (from .../libssl1.0.0_1.0.1c-4ubuntu8.1_i386.deb) ...
    Selecting previously unselected package libaudio2:i386.
    Unpacking libaudio2:i386 (from .../libaudio2_1.9.3-5ubuntu0.13.04.1_i386.deb) ...
    Selecting previously unselected package liblcms1:i386.
    Unpacking liblcms1:i386 (from .../liblcms1_1.19.dfsg-1.2ubuntu2_i386.deb) ...
    Selecting previously unselected package libmng1:i386.
    Unpacking libmng1:i386 (from .../libmng1_1.0.10-3build1_i386.deb) ...
    Selecting previously unselected package libqtcore4:i386.
    Unpacking libqtcore4:i386 (from .../libqtcore4_4%3a4.8.4+dfsg-0ubuntu9.4_i386.deb) ...
    Selecting previously unselected package libqt4-xml:i386.
    Unpacking libqt4-xml:i386 (from .../libqt4-xml_4%3a4.8.4+dfsg-0ubuntu9.4_i386.deb) ...
    Selecting previously unselected package libqt4-dbus:i386.
    Unpacking libqt4-dbus:i386 (from .../libqt4-dbus_4%3a4.8.4+dfsg-0ubuntu9.4_i386.deb) ...
    Selecting previously unselected package libqt4-network:i386.
    Unpacking libqt4-network:i386 (from .../libqt4-network_4%3a4.8.4+dfsg-0ubuntu9.4_i386.deb) ...
    Selecting previously unselected package libqt4-script:i386.
    Unpacking libqt4-script:i386 (from .../libqt4-script_4%3a4.8.4+dfsg-0ubuntu9.4_i386.deb) ...
    Selecting previously unselected package libqt4-sql:i386.
    Unpacking libqt4-sql:i386 (from .../libqt4-sql_4%3a4.8.4+dfsg-0ubuntu9.4_i386.deb) ...
    Selecting previously unselected package libqt4-xmlpatterns:i386.
    Unpacking libqt4-xmlpatterns:i386 (from .../libqt4-xmlpatterns_4%3a4.8.4+dfsg-0ubuntu9.4_i386.deb) ...
    Selecting previously unselected package libjbig0:i386.
    Unpacking libjbig0:i386 (from .../libjbig0_2.0-2ubuntu1_i386.deb) ...
    Selecting previously unselected package libtiff5:i386.
    Unpacking libtiff5:i386 (from .../libtiff5_4.0.2-4ubuntu2.1_i386.deb) ...
    Selecting previously unselected package libqtgui4:i386.
    Unpacking libqtgui4:i386 (from .../libqtgui4_4%3a4.8.4+dfsg-0ubuntu9.4_i386.deb) ...
    Selecting previously unselected package libqt4-declarative:i386.
    Unpacking libqt4-declarative:i386 (from .../libqt4-declarative_4%3a4.8.4+dfsg-0ubuntu9.4_i386.deb) ...
    Selecting previously unselected package libqt4-opengl:i386.
    Unpacking libqt4-opengl:i386 (from .../libqt4-opengl_4%3a4.8.4+dfsg-0ubuntu9.4_i386.deb) ...
    Selecting previously unselected package libqtwebkit4:i386.
    Unpacking libqtwebkit4:i386 (from .../libqtwebkit4_2.3.0-0ubuntu2_i386.deb) ...
    Selecting previously unselected package libxss1:i386.
    Unpacking libxss1:i386 (from .../libxss1_1%3a1.2.2-1_i386.deb) ...
    Selecting previously unselected package libxv1:i386.
    Unpacking libxv1:i386 (from .../libxv1_2%3a1.0.7-1ubuntu0.13.04.1_i386.deb) ...
    Selecting previously unselected package skype-bin.
    Unpacking skype-bin (from .../skype-bin_4.2.0.11-0ubuntu0.12.04.2_i386.deb) ...
    Selecting previously unselected package skype.
    Unpacking skype (from .../skype_4.2.0.11-0ubuntu0.12.04.2_amd64.deb) ...
    Processing triggers for desktop-file-utils ...
    Processing triggers for gnome-menus ...
    Processing triggers for hicolor-icon-theme ...
    Setting up libssl1.0.0:i386 (1.0.1c-4ubuntu8.1) ...
    Setting up libaudio2:i386 (1.9.3-5ubuntu0.13.04.1) ...
    Setting up liblcms1:i386 (1.19.dfsg-1.2ubuntu2) ...
    Setting up libmng1:i386 (1.0.10-3build1) ...
    Setting up libqtcore4:i386 (4:4.8.4+dfsg-0ubuntu9.4) ...
    Setting up libqt4-xml:i386 (4:4.8.4+dfsg-0ubuntu9.4) ...
    Setting up libqt4-dbus:i386 (4:4.8.4+dfsg-0ubuntu9.4) ...
    Setting up libqt4-network:i386 (4:4.8.4+dfsg-0ubuntu9.4) ...
    Setting up libqt4-script:i386 (4:4.8.4+dfsg-0ubuntu9.4) ...
    Setting up libqt4-sql:i386 (4:4.8.4+dfsg-0ubuntu9.4) ...
    Setting up libqt4-xmlpatterns:i386 (4:4.8.4+dfsg-0ubuntu9.4) ...
    Setting up libjbig0:i386 (2.0-2ubuntu1) ...
    Setting up libtiff5:i386 (4.0.2-4ubuntu2.1) ...
    Setting up libxss1:i386 (1:1.2.2-1) ...
    Setting up libxv1:i386 (2:1.0.7-1ubuntu0.13.04.1) ...
    Setting up libqtgui4:i386 (4:4.8.4+dfsg-0ubuntu9.4) ...
    Setting up libqt4-declarative:i386 (4:4.8.4+dfsg-0ubuntu9.4) ...
    Setting up libqt4-opengl:i386 (4:4.8.4+dfsg-0ubuntu9.4) ...
    Setting up libqtwebkit4:i386 (2.3.0-0ubuntu2) ...
    Setting up skype-bin (4.2.0.11-0ubuntu0.12.04.2) ...
    Setting up skype (4.2.0.11-0ubuntu0.12.04.2) ...
    Processing triggers for libc-bin ...
    ldconfig deferred processing now taking place
    

    Notice that skype is a i386 package. If I use apt-get to install it, I will save myself of headaches later.

    But some people prefer to use .deb packages, then brace yourself because it can get a bit messy. You should manually install all dependencies before hand so your system don't end with unmet dependencies. A command that will help is dpkg-deb -I since it shows the information of the package:

    dpkg-deb -I zynaddsubfx-dssi_2.4.3-3_amd64.deb 
     new debian package, version 2.0.
     size 266936 bytes: control archive=845 bytes.
         917 bytes,    19 lines      control              
         232 bytes,     3 lines      md5sums              
     Package: zynaddsubfx-dssi
     Source: zynaddsubfx
     Version: 2.4.3-3
     Architecture: amd64
     Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
     Original-Maintainer: Debian Multimedia Maintainers <pkg-multimedia-maintainers@lists.alioth.debian.org>
     Installed-Size: 633
     Depends: libasound2 (>= 1.0.16), libc6 (>= 2.15), libgcc1 (>= 1:4.1.1), libjack-jackd2-0 (>= 1.9.5~dfsg-14) | libjack-0.116, libmxml1, libstdc++6 (>= 4.6), zlib1g (>= 1:1.1.4)
    [...]
    

    As you can see, it lists the dependencies, so you only have to sudo apt-get install them and then sudo dpkg -i. Again, prefer installing software from the repositories instead of downloading them and manually installing it with dpkg -i.

    Now, if yours is development, you can install any library using the apt-get syntax. Just add :i386 to the library you want to download, and done. No need to do this manually if you install the software from the repositories.

    Bottom line: No, you can run 32-bit packages without installing ia32-libs, if you install the packages from the repositories, even better. If you are into development, try to always use the APT system.

  • Related Question