Cyberithub

How to Install OpenGL Library on Ubuntu 20.04 LTS (Focal Fossa)

Advertisements

In this article, I will take you through the steps to install OpenGL Library on Ubuntu 20.04 LTS (Focal Fossa). OpenGL is a free and open source cross platform API library for rendering 2D and 3D graphics. This API library is designed to interact with Graphics Processing Unit(GPU) to achieve hardware accelerated rendering. There are multiple OpenGL libraries available for various graphical features. Here we will see the steps to install freeglut OpenGL library on Ubuntu 20.04 LTS based systems. freeglut is an alternative to the OpenGL Utility Toolkit (GLUT) library. More on official website.

 

How to Install OpenGL Library on Ubuntu 20.04 LTS (Focal Fossa)

How to Install OpenGL Library on Ubuntu 20.04 LTS (Focal Fossa)

Also Read: How to Install Ncurses Library on Ubuntu 20.04 LTS (Focal Fossa)

Step 1: Prerequisites

a) You should have a running Ubuntu 20.04 LTS Server.

b) You should have sudo or root access to run privileged commands.

c) You should have apt or apt-get utility available in your Server.

 

Step 2: Update Your Server

In the first step, you need to install all the available updates from default Ubuntu repo by using sudo apt update command and then upgrade the packages to the latest version by using sudo apt upgrade command as shown below.

cyberithub@ubuntu:~$ sudo apt update && sudo apt upgrade
Hit:1 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://in.archive.ubuntu.com/ubuntu focal InRelease
Get:3 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:4 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Hit:5 https://download.sublimetext.com apt/stable/ InRelease
Get:6 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [60.0 kB]
Get:7 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:8 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [94.3 kB]
Get:9 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [2,385 kB]
Get:10 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 DEP-11 Metadata [940 B]
Get:11 http://in.archive.ubuntu.com/ubuntu focal-updates/main i386 Packages [788 kB]
Get:12 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [275 kB]
..............................................................

 

Step 3: Install OpenGL Library

In the next step, you can install OpenGL Library from default Ubuntu repo by using sudo apt install freeglut3-dev command as shown below. This will download and install the package along with all its dependencies.

cyberithub@ubuntu:~$ sudo apt install freeglut3-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
gir1.2-goa-1.0 libfwupdplugin1 libllvm11 libncurses-dev libxmlb1
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
freeglut3 libxt-dev
Suggested packages:
libxt-doc
The following NEW packages will be installed:
freeglut3 freeglut3-dev libxt-dev
0 upgraded, 3 newly installed, 0 to remove and 3 not upgraded.
Need to get 593 kB of archives.
After this operation, 2,484 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
..................................................................

 

Step 4: Verify Installation

After successful installation, you can verify the installed files path by using dpkg -L freeglut3-dev command as shown below.

cyberithub@ubuntu:~$ dpkg -L freeglut3-dev
/.
/usr
/usr/include
/usr/include/GL
/usr/include/GL/freeglut.h
/usr/include/GL/freeglut_ext.h
/usr/include/GL/freeglut_std.h
/usr/include/GL/glut.h
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libglut.a
/usr/share
/usr/share/doc
/usr/share/doc/freeglut3-dev
/usr/share/doc/freeglut3-dev/copyright
/usr/share/doc/freeglut3-dev/download.html
/usr/share/doc/freeglut3-dev/freeglut.html
/usr/share/doc/freeglut3-dev/freeglut_logo.png
/usr/share/doc/freeglut3-dev/freeglut_user_interface.html
/usr/share/doc/freeglut3-dev/index.html
/usr/share/doc/freeglut3-dev/ogl_sm.png
/usr/share/doc/freeglut3-dev/progress.html
/usr/share/doc/freeglut3-dev/structure.html
/usr/lib/x86_64-linux-gnu/libglut.so
/usr/share/doc/freeglut3-dev/changelog.Debian.gz

 

Step 5: Uninstall OpenGL Library

Once you are done using freeglut library, you can choose to uninstall it from your system by using sudo apt remove freeglut3-dev command as shown below.

NOTE:

Please be careful in running below command as sometimes removal of this package might impact other active running applications.
cyberithub@ubuntu:~$ sudo apt remove freeglut3-dev
[sudo] password for cyberithub:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
freeglut3 gir1.2-goa-1.0 libfwupdplugin1 libllvm11 libncurses-dev libxmlb1 libxt-dev
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
freeglut3-dev
0 upgraded, 0 newly installed, 1 to remove and 3 not upgraded.
After this operation, 761 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 198408 files and directories currently installed.)
Removing freeglut3-dev:amd64 (2.8.1-3) ...

Leave a Comment