Skype 4.2 in Ubuntu 13.04 won't open in nVidia Optimus Laptops

Actually this is an answer. Im not asking a question. Last day, I tried to install skype 4.2 on my dell N5110 with nvida Optimus, after the installation when I tried to open skype from dash it didn't open. So then I opened it with Terminal via skype and it gave me an error error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file or directory

So I did the following steps with the help of method mentioned in this link.

Steps:

  1. Open a terminal and type sudo nano /etc/ld.so.conf.d/skype.conf
  2. Add the code /usr/lib/i386-linux-gnu/mesa/ in the next console window, and press ctrl+x to exit, when prompted enter y to say yes
  3. And finally run sudo ldconfig -v

Try this:

Install the package libgl1-mesa-glx:i386

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libgl1-mesa-glx:i386

Launch Skype via:

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

You can put the last statement into a shell script, e.g. ~/bin/skype , or create a .desktop-File with this content:

Name=Skype
Terminal=false
Exec=LD_PRELOAD=/usr/lib/i386-linux-gnu/mesa/libGL.so.1 skype
TargetEnvironment=Unity

UnityLaunchersAndDesktopFiles


Try this (NVIDIA Optimus Ubuntu 13.10):

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

  Selection           Path                                      Priority   Status
------------------------------------------------------------
* 0            /usr/lib/nvidia-331/alt_ld.so.conf         8604      auto mode

  1            /usr/lib/i386-linux-gnu/mesa/ld.so.conf    500       manual mode

  2            /usr/lib/nvidia-331-prime/alt_ld.so.conf   8603      manual mode

  3            /usr/lib/nvidia-331/alt_ld.so.conf         8604      manual mode


Press enter to keep the current choice[*], or type selection number: **1** (Choose native value 1)

$  sudo ldconfig