4

I use the nvidia binary drivers and therefore need those libGL* links in /usr/lib to point to /usr/lib/nvidia-current. But Ubuntu insists on pointing libGL.so.1 (not libGL.so) to libGL.mesa.so whenever I install some opengl related packages.

So far I am fine with always overwriting the wrong link. I would really like to know how I could fix that behaviour, or even where I should look for possible causes of this issue.

EDIT: Maybe I should add that I use nvidia-current from the ubuntu-x-swat ppa:

/u/lib> apt-cache policy nvidia-current
nvidia-current:
  Installed: 275.09.07-0ubuntu1~lucid~xup1
  Candidate: 275.09.07-0ubuntu1~lucid~xup1
  Version table:
 *** 275.09.07-0ubuntu1~lucid~xup1 0
        500 hxxp://ppa.launchpad.net/ubuntu-x-swat/x-updates/ubuntu/lucid/main Packages
        100 /var/lib/dpkg/status
     195.36.24-0ubuntu1~10.04 0
        500 hxxp://de.archive.ubuntu.com/ubuntu/ lucid-updates/restricted Packages
     195.36.15-0ubuntu2 0
        500 hxxp://de.archive.ubuntu.com/ubuntu/ lucid/restricted Packages

I need those because my GTX 460 is not supported by the drivers in the official lucid repositories.

~> update-alternatives --display gl_conf
gl_conf - auto mode
 link currently points to /usr/lib/nvidia-current/ld.so.conf
/usr/lib/mesa/ld.so.conf - priority 500
 slave xorg_extra_modules: /usr/lib/xorg/x11-extra-modules
/usr/lib/nvidia-current/ld.so.conf - priority 9700
 slave libvdpau_nvidia.so: /usr/lib/nvidia-current/vdpau/libvdpau_nvidia.so
 slave libvdpau_nvidia.so.1: /usr/lib/nvidia-current/vdpau/libvdpau_nvidia.so.1
 slave libvdpau_nvidia.so.1_lib32: /usr/lib32/nvidia-current/vdpau/libvdpau_nvidia.so.1
 slave libvdpau_nvidia.so_lib32: /usr/lib32/nvidia-current/vdpau/libvdpau_nvidia.so
 slave man_nvidiaxconfig.gz: /usr/share/man/man1/alt-nvidia-current-xconfig.1.gz
 slave nvidia-autostart.desktop: /usr/share/nvidia-current/nvidia-autostart.desktop
 slave nvidia-smi.1.gz: /usr/share/man/man1/alt-nvidia-current-smi.1.gz
 slave nvidia_bug_report: /usr/lib/nvidia-current/bin/nvidia-bug-report.sh
 slave nvidia_desktop: /usr/share/nvidia-current/ubuntu-nvidia-settings.desktop
 slave nvidia_drv: /usr/lib/nvidia-current/xorg/nvidia_drv.so
 slave nvidia_modconf: /lib/nvidia-current/modprobe.conf
 slave nvidia_smi: /usr/lib/nvidia-current/bin/nvidia-smi
 slave nvidia_xconfig: /usr/lib/nvidia-current/bin/nvidia-xconfig
 slave xorg_extra_modules: /usr/lib/nvidia-current/xorg
 slave xvmcconfig: /usr/lib/nvidia-current/XvMCConfig
Current `best' version is /usr/lib/nvidia-current/ld.so.conf.
~> ls -la /etc/alternatives/gl_conf 
lrwxrwxrwx 1 root root 34 2010-09-08 18:51 /etc/alternatives/gl_conf -> /usr/lib/nvidia-current/ld.so.conf
~> cat /usr/lib/nvidia-current/ld.so.conf 
/usr/lib/nvidia-current
/usr/lib32/nvidia-current
~>

This is the layout of /usr/lib/libGL symlinks when everything is working correctly:

~> ls -la /usr/lib/libGL*
-rw-r--r-- 1 root root 487480 2010-01-17 08:07 /usr/lib/libGLEW.a
lrwxrwxrwx 1 root root     16 2010-05-02 05:25 /usr/lib/libGLEW.so -> libGLEW.so.1.5.2
lrwxrwxrwx 1 root root     16 2010-05-02 05:22 /usr/lib/libGLEW.so.1.5 -> libGLEW.so.1.5.2
-rw-r--r-- 1 root root 358456 2010-01-17 08:07 /usr/lib/libGLEW.so.1.5.2
lrwxrwxrwx 1 root root     13 2010-09-08 18:25 /usr/lib/libGL.mesa.so -> mesa/libGL.so
lrwxrwxrwx 1 root root     32 2011-07-15 23:34 /usr/lib/libGL.so -> /usr/lib/nvidia-current/libGL.so
lrwxrwxrwx 1 root root     34 2011-07-16 19:01 /usr/lib/libGL.so.1 -> /usr/lib/nvidia-current/libGL.so.1
-rw-r--r-- 1 root root 929838 2010-04-29 07:54 /usr/lib/libGLU.a
lrwxrwxrwx 1 root root     11 2010-05-16 18:38 /usr/lib/libGLU.so -> libGLU.so.1
lrwxrwxrwx 1 root root     20 2010-05-16 18:38 /usr/lib/libGLU.so.1 -> libGLU.so.1.3.070701
-rw-r--r-- 1 root root 461488 2010-04-29 07:54 /usr/lib/libGLU.so.1.3.070701

When I for example remove and install libglfw2 only the libGL.so.1 link changes to point to libGL.mesa.so:

~> sudo apt-get remove libglfw2; sudo apt-get install libglfw-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  libglfw-dev libglfw2
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
[...]
The following extra packages will be installed:
  libglfw2
The following NEW packages will be installed:
  libglfw-dev libglfw2
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/86.6kB of archives.
After this operation, 360kB of additional disk space will be used.
Selecting previously deselected package libglfw2.
(Reading database ... 727685 files and directories currently installed.)
Unpacking libglfw2 (from .../libglfw2_2.6-2_amd64.deb) ...
Selecting previously deselected package libglfw-dev.
Unpacking libglfw-dev (from .../libglfw-dev_2.6-2_amd64.deb) ...
Setting up libglfw2 (2.6-2) ...

Setting up libglfw-dev (2.6-2) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
~>

Afterwards this is the /usr/lib/libGL* layout:

~> ls -la /usr/lib/libGL*
-rw-r--r-- 1 root root 487480 2010-01-17 08:07 /usr/lib/libGLEW.a
lrwxrwxrwx 1 root root     16 2010-05-02 05:25 /usr/lib/libGLEW.so -> libGLEW.so.1.5.2
lrwxrwxrwx 1 root root     16 2010-05-02 05:22 /usr/lib/libGLEW.so.1.5 -> libGLEW.so.1.5.2
-rw-r--r-- 1 root root 358456 2010-01-17 08:07 /usr/lib/libGLEW.so.1.5.2
lrwxrwxrwx 1 root root     13 2010-09-08 18:25 /usr/lib/libGL.mesa.so -> mesa/libGL.so
lrwxrwxrwx 1 root root     32 2011-07-15 23:34 /usr/lib/libGL.so -> /usr/lib/nvidia-current/libGL.so
lrwxrwxrwx 1 root root     13 2011-07-16 20:15 /usr/lib/libGL.so.1 -> libGL.mesa.so
-rw-r--r-- 1 root root 929838 2010-04-29 07:54 /usr/lib/libGLU.a
lrwxrwxrwx 1 root root     11 2010-05-16 18:38 /usr/lib/libGLU.so -> libGLU.so.1
lrwxrwxrwx 1 root root     20 2010-05-16 18:38 /usr/lib/libGLU.so.1 -> libGLU.so.1.3.070701
-rw-r--r-- 1 root root 461488 2010-04-29 07:54 /usr/lib/libGLU.so.1.3.070701
~>
9
  • I have no libGL.so(.1) in /usr/lib - only in /usr/lib/mesa and /usr/lib/nvidia-current. Can you please add the output of update-alternatives --display gl_conf and ls -al /etc/alternatives/gl_conf to your question?
    – htorque
    Jul 16, 2011 at 17:38
  • Also, can you please elaborate what you mean with "whenever I install some opengl related packages". Like which one?
    – htorque
    Jul 16, 2011 at 17:50
  • with 'opengl related packages' I actually only meant libglfw2, I am assuming that it does trigger something that 'all opengl related packages' do, which somehow makes the link point to mesa instead of nvidia
    – rakete
    Jul 16, 2011 at 18:01
  • Hm, output looks fine to me. Do you really have a libGL.so(.1) file directly in /usr/lib/? I installed the ubuntu-x-swat/x-updates PPA w/o seeing something similar. Installing libglfw2 also didn't do a thing.
    – htorque
    Jul 16, 2011 at 18:09
  • As those are just links that can be recreated anytime, can you try to remove libGL.mesa.so, libGL.so, and libGL.so.1 from /usr/lib and run sudo ldconfig? Also, does this actually cause any problems?
    – htorque
    Jul 16, 2011 at 18:22

1 Answer 1

2

I'm making this an answer, if you still have any problems, leave a comment and I'll delete it.

Remove those symbolic links:

/usr/lib/libGL.mesa.so
/usr/lib/libGL.so
/usr/lib/libGL.so.1

As far as I can tell, those links shouldn't be there by default and the "alternatives system" should take care of which libGL files get used.

1
  • I just wanted to add that my problem turned out to be that libGL.mesa.so link (which I probably created when I created the other links as 'backup'). Without it everything is fine and ubuntu won't link libGL.so.1 to the mesa libs.
    – rakete
    Jul 24, 2011 at 20:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .