51

When attempting to run various pieces of software (notably Steam and Yenka), I have come across an error similar to this: error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file or directory

I'm running a 64 bit system, with an NVidia Optimus card (I dual boot for certain windows only software that requires a dedicated graphics card). I have bumblebee installed, and I am using the nvidia-current driver, rather that one downloaded from NVidia, as recommended.

The library (libGL.so.1) is not present in the top directory of /usr/lib, however it is present in /usr/lib32/nvidia-current, as a softlink to /usr/lib32/nvidia-current/libGL.so.304.64.

A section of the output from ldconfig -p:

libGL.so.1 (libc6,x86-64, OS ABI: Linux 2.4.20) => /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
libGL.so (libc6,x86-64, OS ABI: Linux 2.4.20) => /usr/lib/x86_64-linux-gnu/libGL.so
libGL.so (libc6,x86-64, OS ABI: Linux 2.4.20) => /usr/lib/x86_64-linux-gnu/mesa/libGL.so

Obviously a library with that name is being loaded, but they are located in /usr/lib/x86_64-linux-gnu, however installed software doesn't seem to able to 'see' it. For Steam, running it with optirun causes it to work, but this is not the case for Yenka. I assume that optirun causes the library stored in /usr/lib32/nvidia-current to be used, which allows Steam to run, so I can't understant why Yenka won't run.

Can anyone explain why software can't see the normal mesa library, and why Yenka refuses to run with the nvidia-current library?

dobey
  • 41,650

8 Answers8

52

I am having the same issue after installing skype ...so you can do either thing to fix this error..

1st one is run the application by following command ...for example i m running skype..

LD_PRELOAD=/usr/lib/i386-linux-gnu/mesa/libGL.so.1 skype

S O U R C E

2nd that what i did

sudo nano /etc/ld.so.conf.d/skype.conf

and add the following line in it

/usr/lib/i386-linux-gnu/mesa/

save & exit

and lastly run

sudo ldconfig -v

i hope this will fix your libGL.so.1 error as it did mine

You can also find libGL.so.1

   find / -name libGL.so.1
Qasim
  • 22,162
39

With the nvidia drivers installed skype is looking for an i386 lib provided by the nvidia package. Since that doesn't exist, it is ok to use the i386 libGL.so.1 provided by mesa.

Tested on (ubuntu-gnome raring, using nvidia-325) and (ubuntu-gnome saucy, using nvidia-319) we were able to fix this by the following:

update-alternatives --display i386-linux-gnu_gl_conf

This will show you what the available options are.

i386-linux-gnu_gl_conf - auto mode
  link currently points to /usr/lib/nvidia-325/alt_ld.so.conf
/usr/lib/i386-linux-gnu/mesa/ld.so.conf - priority 500
  slave i386-linux-gnu_xorg_extra_modules: /usr/lib/i386-linux-gnu/xorg/x11-extra-modules
/usr/lib/nvidia-325/alt_ld.so.conf - priority 8602
Current 'best' version is '/usr/lib/nvidia-325/alt_ld.so.conf'

so, do the following:

sudo update-alternatives --config i386-linux-gnu_gl_conf

then select the best alternative (I selected i386-linux-gnu/mesa/ld.so.conf): In the output below there are two choices for the alternative i386-linux-gnu_gl_conf (providing /etc/ld.so.conf.d/i386-linux-gnu_GL.conf).

  Selection    Path                                     Priority   Status
------------------------------------------------------------
* 0            /usr/lib/nvidia-325/alt_ld.so.conf        8602      auto mode
  1            /usr/lib/i386-linux-gnu/mesa/ld.so.conf   500       manual mode
  2            /usr/lib/nvidia-325/alt_ld.so.conf        8602      manual mode

Press enter to keep the current choice[*], or type selection number: 1
update-alternatives: using /usr/lib/i386-linux-gnu/mesa/ld.so.conf to provide /etc/ld.so.conf.d/i386-linux-gnu_GL.conf (i386-linux-gnu_gl_conf) in manual mode

After you have completed that, try running:

sudo ldconfig

and then you're done.

Georg
  • 143
Ch4ni
  • 506
12

The fixes here will work, but there's a simpler one.

If skype doesn't work but optirun skype does work, then you can fix it with:

sudo apt-get install bumblebee-nvidia --reinstall

(People using Bumblebee with AMD cards may need to do the equivalent re-installation).

Bumblebee both causes and fixes this problem, but the fix it applies happens upon installation, when it makes the libGL libraries available to the integrated card as well as the more powerful card. This won't happen if those libraries weren't already installed when you installed Bumblebee, hence needing a re-installation. It shouldn't affect your bumblebee configuration either, though it's obviously worth checking after you've done this.

Jon Hanna
  • 763
3

Edit the desktop entry:

sudo nano /usr/share/applications/skype.desktop

Change the Exec to:

Exec=env PULSE_LATENCY_MSEC=60 LD_PRELOAD=/usr/lib/i386-linux-gnu/mesa/libGL.so.1 skype %U

This runs:

LD_PRELOAD=/usr/lib/i386-linux-gnu/mesa/libGL.so.1

before running skype when you start it with the launcher / desktop entry.

It should run fine after that as long as you start it using the application launcher.

hazmat
  • 181
1

I'm not sure if this'll help clarify or not but I had the same issue with skype and libGL.so.1. Also running 13.04 with an optimus card and bumblebee.

I got the issue running skype without optirun, but it worked fine with. I just changed the desktop file to run with optirun every time and voila. fixed!

1

I had a similar problem and solved it by installing 32bit libs on my 64bit system: apt-get install ia32-libs

Matt
  • 121
0

Download the latest version from the official steam page, than let it download what it needs from the terminal(if any needs). than add bumblebee ppa if you did not already.

sudo add-apt-repository ppa:bumblebee/stable

update it with this command:

sudo apt-get update

and install virtualgl(that solved the libgl.so.1 error stuff for me in Steam)

sudo apt-get install virtualgl
hmayag
  • 2,266
  • 5
  • 22
  • 24
0

Try:

sudo apt-get install libgl1-mesa-glx-lts-utopic:i386
Donkey
  • 37