Posted on
Administration

Installing 32-bit libraries on a 64-bit RHEL system

Author
  • User
    Linux Bash
    Posts by this author
    Posts by this author

Installing 32-Bit Libraries on a 64-Bit RHEL System

With the increasing adoption of 64-bit systems, there are scenarios in which you might still need to run applications that require 32-bit libraries even on a 64-bit version of Red Hat Enterprise Linux (RHEL). This could involve software that hasn't been updated to a 64-bit architecture or proprietary tools that only provide 32-bit binaries.

In this blog, we'll guide you through the process of installing 32-bit libraries on a 64-bit RHEL system. We'll also cover the instructions for doing similar installations using different package managers like apt, dnf, and zypper, for those who might be using derived distributions like Ubuntu or openSUSE.

Understanding Multiarch

Multiarch allows you to install libraries from multiple architectures on the same machine. This is what enables a 64-bit system to run software built for a 32-bit architecture.

Installing 32-bit Libraries on RHEL

RHEL uses dnf as its package management tool. Here's how you can install 32-bit libraries:

  1. Enable the 32-bit Repository: Before you start installing the libraries, make sure that the system is configured to support 32-bit architecture packages:

    sudo dnf install glibc.i686
    
  2. Install Libraries: Once the basic support is in place, you can install other 32-bit libraries as needed. For example, to install a 32-bit SDL library, you would use:

    sudo dnf install SDL.i686
    

    Replace SDL with whatever library you're looking to install.

Using Other Package Managers

Although RHEL does not natively use apt or zypper, you might need these instructions if you are working with distributions derived from or similar to RHEL, or when deploying Docker containers or similar environments. Let's look at how this can be accomplished with different package managers.

Ubuntu and Derived Distributions Using apt

Ubuntu uses apt for package management. Before installing 32-bit libraries, you need to add the i386 architecture support:

  1. Add Architecture Support:

    sudo dpkg --add-architecture i386
    sudo apt update
    
  2. Install 32-bit Libraries:

    sudo apt install libc6:i386 libncurses5:i386 libstdc++6:i386
    

    You can replace the libraries in the command above with those you require.

openSUSE and SUSE Linux Enterprise Server Using zypper

For systems using zypper, the process is somewhat similar:

  1. Add Architecture Support: On openSUSE, you typically do not need to add a new architecture like on Ubuntu, as the RPM package manager and zypper handle multi-lib support natively.

  2. Install 32-bit Libraries:

    sudo zypper install libgtk-2-0-32bit
    

    Again, replace libgtk-2-0-32bit with the required 32-bit library package name.

Conclusion

Installing 32-bit libraries on a 64-bit Linux system is straightforward once you understand the concept of multiarch and configure your package manager accordingly. Whether you're using dnf, apt, or zypper, the process only differs slightly between distributions. This capability ensures backward compatibility and the seamless running of older software applications on modern hardware.

Most importantly, always ensure that your system is updated and that you are pulling packages from trusted repositories. Happy computing!