Linux 32bit on 64bit

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

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?

@bain This is not a duplicate. This question is about general situations, that is a specific issue, not to mention this is the older, better question.

2 Answers 2

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.
Читайте также:  Usb to serial linux drivers

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.

Читайте также:  Linux microsoft lifecam hd 3000

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 Original-Maintainer: Debian Multimedia Maintainers 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.

Источник

How to Run 32-bit App on 64-bit Linux

run 32-bit app on 64-bit

Almost every Linux system is available for 32-bit system architecture as well as 64-bit architecture. But the problem is that, by default, an application written to run on 32-bit system will not work on a 64-bit system and vice versa. This can be really painful since nobody wants to develop two source codes for the same application or maintain 2 separate binary files, for different architecture. You can solve this by making a 32-bit program to be able to run on 64-bit architecture. In this article, we will learn how to run 32-bit app on 64-bit Linux.

Читайте также:  Deleting all files in directory linux

How to Run 32-bit App on 64-bit Linux

Here are the steps to run 32-bit app on 64-bit Linux. To be able to run a 32-bit program on 64-bit Linux system such as Ubuntu, you need to add i386 architecture and install 3 library packages libc6:i386, libncurses5:i386, and libstdc++6:i386.

1. Add 1386 Architecture

Open terminal and run the following command to do it.

$ sudo dpkg --add-architecture i386
$ echo "foreign-architecture i386" > /etc/dpkg/dpkg.cfg.d/multiarch

2. Install Required Package Libraries

Then run the following command to install 3 package libraries.

$ sudo apt-get update $ sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386

If the above command fails, run the following command instead.

$ sudo apt-get install multiarch-support

3. Execute 32-bit Program

Now you should be able to run your 32-bit program on 64-bit system. Replace sample32bitprogram below with the filename of your program’s binary.

4. Troubleshooting

If you are running an incompatible version of gcc on your Ubuntu system you may get an error while running above commands, you may need to update your system gcc using the following command.

$ sudo apt-get install gcc-multilib

In this article, we have learnt how to run 32-bit programs on 64-bit, without creating separate binary files for both 32-bit as well as 64-bit systems.

Источник

Оцените статью
Adblock
detector