how to dowload libgl.so.1?

12,152

Solution 1

I was generating a /usr/bin/ld: cannot find -lGL error when attempting to install kivy on ubuntu mate in virtualbox. Using the workaround below, I was able to complete the installation successfully using the following instructions.

sudo apt install libglu1-mesa-dev

Solution 2

As you know, i386 means the package you are trying to install is for 32bit system.

As explained here: https://askubuntu.com/questions/522372/installing-32-bit-libraries-on-ubuntu-14-04-lts-64-bit you can install 32bit libraries in 64bit system.

At this link we read https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/949606 :

64 bit dev packages contain a 64 bit version of the library file(s) that they provide for linking but not a 32 bit version of the library file(s). In previous versions of Ubuntu, however, it was possible to compile 32 bit applications using the 64 bit dev packages in by installing ia32-libs, which contained the required 32 bit library files.

In the move to multiarch, 32 bit library files are being removed from ia32-libs. Multiarch (I assume) aims to keep the architectures separate, so the generally intended solution is to install the i386 version of the dev package when compiling 32 bit applications, ie side-by-side with the 64 bit dev package.

However, some 64 bit development packages conflict with their 32 bit equivalent. This creates a regressive situation where it is impossible to install them side-by-side - you are forced to either install the 32 bit package, which breaks 64 bit compilations, or the 64 bit package, which breaks 32 bit compilations.

An example is libglu1-mesa-dev, which conflicts with libglu1-mesa-dev:i386. The libglu1-mesa-dev file contains all the necessary development files for 32 bit except for the 32 bit library file. It does contain the 64 bit library file. Since the library file is part of the development files, libglu1-mesa-dev does not contain all the necessary development files for 32 bit, ie it does not contain all the necessary development files for multiarch. I think that it should contain all the necessary files for building multarch applications.

The two workarounds are:

  1. Manually re-install the required i386 dev packages before compiling 32 bit apps, and then manually re-install the required amd64 dev packages before compiling 64 bit apps. This is a real pain.

  2. Install the i386 binary package (eg libglu1-mesa:i386) and the amd64 dev package (eg libglu1-mesa-dev), and manually create symlinks for the i386 libXYZ.so package (eg sudo ln -s /usr/lib/i386-linux-gnu/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so). This is a more permanent solution but is a real pain to set up, as you have to find each missing library manually, and some library files, like mesa/libGL.so.1, are in subfolders.

Share:
12,152

Related videos on Youtube

orion tree
Author by

orion tree

Updated on September 18, 2022

Comments

  • orion tree
    orion tree 3 months

    So I am running 64-bit hardware with Ubuntu and I am trying to play Quake 3 but I can't install Libgl1.

     sudo apt-get install --reinstall libgl1-mesa-glx:i386
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Reinstallation of libgl1-mesa-glx:i386 is not possible, it cannot be downloaded.
    0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.