I was just wondering what command I would use in front or behind a file name to install (I am very new to Linux and nothing seems to work for me, not even steam).

4 Answers 4


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


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
  • this is the same as my answer :(
    – phil294
    May 6, 2023 at 15:41
  • Using your solution in a Dockerfile wont work. Therefore your solution is not targetting Docker users. Whereas mine is. Hence there are two different answers. The only similarities here is the package used of course, but this is not what it makes it the same answer. We are here to help people, not chasing points and fame don't forget that.
    – Amin NAIRI
    May 14, 2023 at 8:02

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


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



Install them with:

sudo apt-get install <package-name>
  • 12
    thanks everyone, but I'm moving to Windows... Jun 7, 2015 at 0:06
  • 2
    and which one do i choose? whatever i like? . edit actually, there is a package called nvidia-latest
    – phil294
    May 14, 2017 at 14:48

You must log in to answer this question.

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