how to install libGL files

Solution 1:

Most probably you'll want apt-get install libgl1-mesa-glx. Found that by apt-cache search libgl |egrep '^libgl[^a-z]'.

Solution 2:

The file libGL.so is in various different packages. Depending on your graphic card choose one of them:

package-name:

fglrx
fglrx-updates
nvidia-173
nvidia-304-updates
nvidia-304
nvidia-331-updates

Install them with:

sudo apt-get install <package-name>

Solution 3:

There are many tools to install packages in Ubuntu, some of these tools are GUI (such as Ubuntu Software Center - Synaptic - etc ...) while others still CLI if you like the command line mode(such as apt-get , dpkg , aptitude ...).

The most known command to install a package is

sudo apt-get install package-name

So all of what you want to do is to insert the correct package name.

So for your question you can run;

sudo apt-get install libgl

But this would produce an error

E: Unable to locate package libgl

why? because the package name is not correct. A nice trick in Linux terminal is to use double Tab to autocomplete so while writing the command above do the trick. the output would be like:

$sudo apt-get install libgl  

hit double Tab output will be

Display all 272 possibilities? (y or n)

This means you have 272 possible packages starting with name libgl,

so you have to know exactly what you want to install.

This is just a start to know more about software installation in Ubuntu you probably have to read this https://help.ubuntu.com/community/InstallingSoftware and also this link https://wiki.ubuntu.com/SoftwareCenter would be helpful

Solution 4:

If you are using Docker, you probably want to install libgl1-mesa-glx. Here, an example for a node container.

FROM node:10.0.0

RUN apt-get update && apt-get install libgl1-mesa-glx