Error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file or directory

64bitdynamic-linkinglibrarieslinkeropensuse

anisha@linux-y3pi:~/> google-earth 
./googleearth-bin: error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file or directory

anisha@linux-y3pi:~/> locate libGL
/opt/google/earth/free/libGLU.so.1
/usr/lib64/libGL.so
/usr/lib64/libGL.so.1
/usr/lib64/libGL.so.1.2
/usr/lib64/libGLU.so.1
/usr/lib64/libGLU.so.1.3.070802

anisha@linux-y3pi:~/> uname -a
Linux linux-y3pi 2.6.34-12-desktop #1 SMP PREEMPT 2010-06-29 02:39:08 +0200 x86_64 x86_64 x86_64 GNU/Linux

On OpenSUSE, try zypper in Mesa-32bit to install the 32 bit version of the library.

linux-y3pi:# zypper in Mesa-32bit
Retrieving repository 'google-chrome' metadata [\]
Failed to download /repodata/repomd.xml from http://dl.google.com/linux/chrome/rpm/stable/x86_64
Abort, retry, ignore? [a/r/i/?] (a): r
Retrieving repository 'google-chrome' metadata [|]
Failed to download /repodata/repomd.xml from http://dl.google.com/linux/chrome/rpm/stable/x86_64
Abort, retry, ignore? [a/r/i/?] (a): i
Retrieving repository 'google-chrome' metadata [error]
Repository 'google-chrome' is invalid.
Can't provide /repodata/repomd.xml : User-requested skipping of a file
Please check if the URIs defined for this repository are pointing to a valid repository.
Warning: Disabling repository 'google-chrome' because of the above error.
Retrieving repository 'google-earth' metadata [/]
Failed to download /repodata/repomd.xml from http://dl.google.com/linux/earth/rpm/stable/i386
Abort, retry, ignore? [a/r/i/?] (a): r
Failed to download /repodata/repomd.xml from http://dl.google.com/linux/earth/rpm/stable/i386
Abort, retry, ignore? [a/r/i/?] (a):

Best Answer

Like Renan said, this is the result of a 32/64 bit mismatch. On OpenSUSE, try zypper in Mesa-32bit to install the 32 bit version of the library. In general, if you have the 64 bit version, you can use rpm -qf to find the package containing the library:

% rpm -qf /usr/lib64/libGLU.so.1
Mesa-7.11-11.4.2.x86_64

On OpenSUSE, the naming convention for 32bit-libraries is to append -32bit to the package name, so strip version and architecture information and add the suffix to obtain Mesa-32bit.

Related Question