Skip to main content

How to Run 32-bit Apps in 64-bit Linux

Most Linux distributions have 64-bit versions for x86_64 processors, such as the AMD Athlon II or the Intel Xeon. Since these distributions maintain their own package repositories, they usually provide binary packages for all of their supported applications. If you are completely content with your out-of-box Linux installation, you may never need to run a 32-bit program.

Some commercial Linux software, particularly games, only provide 32-bit versions. In these rare cases, you will need to configure your 64-bit machine to run 32-bit software.

Install the 32-bit libraries

Because x86_64 processors are designed over x86 technology, they are still able to support 32-bit programs without any hardware emulation, like what you would need to run x86 programs in a PowerPC or Sparc environment. In Linux, all you need to do is install the necessary software libraries to run the 32-bit software. Fortunately, many Linux distributions package these libraries for you. In Ubuntu, for example, the package is called ia32-libs. To install it, just open a terminal window and type:

$ sudo apt-get install ia32-libs

You can also install it graphically from within Synaptic or Kpackagekit on Kubuntu.

Once installed, applications like Skype and games like World of Padman should work without further configuration.

GTK Issues

When running 32-bit programs in a 64-bit environment, Ubuntu still looks for the default GTK engines. This will cause you to receive an error such as this: “wrong ELF class”. This type of error can be particularly annoying in applications like Chromium, the new open source version of the Google Chrome browser.

Ubuntu does actually install the default 32-bit version of the GTK engines in /usr/lib32/gtk-2.0, but what I discovered in my case was that GTK themes like the one I was using, qtcurve, were not found in this directory. The result was really ugly GTK programs.

The quick solution was to do the following:

1. Find the 32-bit package of the theme you are using. In my case, I searched ubuntu packages.

2. Download the package and extract its contents like you would a normal compressed file.

3. Find the library file for the theme. For qtcurve it was found at ~/download-directory/usr/lib/gtk-2.0/2.10.0/engines/libqtcurve.so.

4. Copy the library to the lib32 directory:
$ sudo cp ~/download-directory/usr/lib/gtk-2.0/2.10.0/engines/libqtcurve.so /usr/lib32/gtk-2.0/2.10.0/engines/
For Chromium this was all that was required because the Chromium startup script was already configured to look in /usr/lib32/gtk-2.0. If the startup script of the program you are running does not look there but instead looks to /usr/lib/gtk-2.0, you will need to modify the startup script or export an environment variable before starting it by opening a terminal window and typing:
export GTK_PATH=/usr/lib32/gtk-2.0
command-to-start-app
If there is no startup script for the program, you could create one with the above environment variable set.

If All Else Fails

I have found some applications, such as Boxee, refuse to behave nicely in a 64-bit environment under any normal circumstances, even with ia32-libs installed. The only viable alternative besides chucking your 64-bit machine or chucking the software is to run it in a chroot environment. This literally installs an entire 32-bit version of your operating system within a directory on your computer. It will take more space than simply installing a few libraries, but it ensures that all of the 32-bit components, including 3D graphics kernel modules, are installed.

You can read a guide to setting up a 32-bit chroot on Ubuntu Forums.


Original post: http://maketecheasier.com/run-32-bit-apps-in-64-bit-linux/2009/08/10

Comments

Popular posts from this blog

Howto Install BSNL wll clarity phone in Ubuntu

Hello linixians, Failed to access internet through your bsnl clarity phone.... Here is an easy way 1. Just download this executable..... bsnlclarity and save it to your home folder. 2. Connect your phone to the system with the usb cable. 3. Now at terminal type $ sudo ./bsnlclarity You will be asked for your username and password for accessing the internet enter it ..... now start surffing Ctrl+C to stop

Blank (or black) screen after boot process in Ubuntu

You may encounter a blank screen after boot in ubuntu. This will be due to some update of certain packages. Follow these steps to correct the problem. 1. Select recovery mode from the boot menu. 2. Select login as root from the menu in recovery mode. 3. Type this at the prompt # sudo apt-get remove xorg-driver-fglrx # sudo dpkg-reconfigure -phigh xserver-xorg 4. Exit # exit 5. Now select Resume normal boot from the menu. Every thing should be OK by now. Please comment about your experience.

gtalx: Howto Gtalk in ubuntu ( google talk )

Did you fail to use " gtalk in ubuntu " ... Now you can chat and talk to your gmail buddies in ubuntu... 1. check for gtk2.0 and qt4 $ sudo apt-get install libgtk2.0-dev $ sudo apt-get install libqt4-dev libogg-dev libtheora-dev $ sudo apt-get install libsdl-dev libavcodec-dev libswscale-dev $ sudo apt-get install libexpat-dev libraw1394-dev libvorbis-dev $ sudo apt-get install libgsm1-dev  libspeexdsp-dev libmediastreamer0-dev libortp-dev 2. Remove 'pulse audio sound server' Open synaptic package manager and remove pulse audio 3. "Download gtalx" from here Dowload it here 4. Extract the file.... $ tar -zxvf 0.0.4.tar.gz 5. Get into the directory.... $ cd 0.0.4 and then... $ sudo chmod u+x make $ ./make $ sudo ./make install 6. Enjoy..... Please comment about your installation(whether it was a success or not....) Take gtalx from Applications > Internet > gtalx Enter your gmail login information..and click connect...