Ok found the problem.
Removing fglrx or deactivating it doesn't remove the file
/etc/X11/Xsession.d/10fglrx
That is run sometime after the /etc/environment (since i tried to put the correct values there, but was replaced by this)
That contains this code:
LIBGL_DRIVERS_PATH=/usr/lib/fglrx/dri
if [ `uname -m` = 'x86_64' ]; then
if [ -d /usr/lib32/fglrx/dri ]; then
LIBGL_DRIVERS_PATH=${LIBGL_DRIVERS_PATH}:/usr/lib32/fglrx/dri
if [ ! -z $LD_LIBRARY_PATH ]; then
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:
fi
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}/usr/lib32
export LD_LIBRARY_PATH
fi
fi
export LIBGL_DRIVERS_PATH
Ok found the problem. Xsession. d/10fglrx
Removing fglrx or deactivating it doesn't remove the file
/etc/X11/
That is run sometime after the /etc/environment (since i tried to put the correct values there, but was replaced by this)
That contains this code: PATH=/usr/ lib/fglrx/ dri fglrx/dri ]; then DRIVERS_ PATH=${ LIBGL_DRIVERS_ PATH}:/ usr/lib32/ fglrx/dri PATH=$LD_ LIBRARY_ PATH: LIBRARY_ PATH=${ LD_LIBRARY_ PATH}/usr/ lib32
LIBGL_DRIVERS_
if [ `uname -m` = 'x86_64' ]; then
if [ -d /usr/lib32/
LIBGL_
if [ ! -z $LD_LIBRARY_PATH ]; then
LD_LIBRARY_
fi
LD_
export LD_LIBRARY_PATH
fi
fi
export LIBGL_DRIVERS_PATH