https://en.wikibooks.org/wiki/OpenGL_Programming/Installation/Linux
OpenGL Installation on Linux
Most Linux distributions rely on the Mesa3D project to provide their OpenGL implementation. This supplies libraries for regular OpenGL as well as OpenGL ES 1.x and 2.0.
The exact names of the packages you need to install are highly dependent on distribution. Referring to your distro's packages can save you a lot of time and headache in installation. Use your favorite package manager and search for the package name. You may need to install packages that come with a dev suffix, these are development packages (usually header files). Also look for packages with a lib prefix, which refer to libraries.
Install the GCC C/C++ compilers and associated tools such as make.
All in all, install Mesa, Make and GCC/g++:
sudo apt-get install build-essential libgl1-mesa-dev # Debian, Ubuntu
sudo dnf install make gcc-c++ # Fedora
Libraries
In this wikibooks, we'll make great use of GLEW, SDL2 (+SDL2_Image), GLM and FreeType. Make sure you install the development libraries:
sudo apt-get install libglew-dev libsdl2-dev libsdl2-image-dev libglm-dev libfreetype6-dev # Debian, Ubuntu
sudo dnf install glew-devel SDL2-devel SDL2_image-devel glm-devel freetype-devel # Fedora
sudo pacman -S glew sdl2 sdl2_image glm freetype2 # Arch
If GLM is not available in your distribution repository, you have the option to install it manually. Make sure the headers end in the /usr/include/glm
directory. Since it's a headers-only library, you do not need to compile a .so library - just copy the code there.
Check your OpenGL installation
Type this in a terminal to get much info about your OpenGL driver, including supported extensions:
glxinfo | grep OpenGL