Opensuse

載入共享庫時出錯:libGL.so.1:無法打開共享對象文件:沒有這樣的文件或目錄

  • July 9, 2012
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

> > 在 OpenSUSE 上,嘗試使用 Mesa-32bit 中的 zypper 來安裝 32 位版本的庫。 > > >

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):

就像 Renan 說的,這是 32/64 位不匹配的結果。在 OpenSUSE 上,嘗試zypper in Mesa-32bit安裝 32 位版本的庫。一般來說,如果你有 64 位版本,你可以使用rpm -qf找到包含該庫的包:

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

在 OpenSUSE 上,32 位庫的命名約定是附加-32bit到包名之後,因此去掉版本和架構資訊並添加後綴以獲得Mesa-32bit.

在我的 64 位機器上,我通常將任何匹配的 32 位庫安裝到我的 64 位庫中,所以我不會遇到這個問題。當然,這是我可能不需要或從未使用過的額外庫,但話又說回來,我通常也不會遇到這些錯誤。

引用自:https://unix.stackexchange.com/questions/42628