I currently installed ubuntu 11.10 on my acer netbook. I have problem getting some packages I need. I am using the most updated version and have a wifi connection on my campus. This is what my instructor wishes for us to do:

  1. select Applications/Accessories/Terminal on the Ubuntu desktop
  2. type ls /usr/include/GL
    if glut.h gl.h etc are there, great
    if not, install it sudo apt-get install libglut3-dev
  3. I then copied program1.c to the desktop
  4. cd desktop
  5. gcc -lglut -lGLU program1.c note l is a lower-case L, which means library in UNIX
  6. ./a.out to execute

I complete step 2, in which returns:

sudo: ls/brandon/include/GL: command not found

so from here I do the apt-get and try to install it but returns me with this:

E: Unable to locate package libglut3-dev

Does this have to do with my connection or is there something I need to be doing on my system for it to find the package and install it. I'm really new to ubuntu and could use some help just getting started.

  • Step 2 was to type the command ls /usr/include/GL and not ls/brandon/include/GL. Not your user name but usr. There is a space between ls and the path /usr/include/GL. Because there is no space the terminal is seeing what you typed as a single command which does not exist and not a command followed by an option. You need to find out if there are files in the GL directory such as glut.h, gl.h and the rest. To get more information about the ls command type man ls - regards Jan 17, 2012 at 1:38
  • Thank you, but I still seem to have a problem, upon entering the correct command It responds with: ls: cannot access /usr/include/GL: No such file or directory. I don't know what could be the problem. Jan 17, 2012 at 1:42
  • I would like to say that as good as this site is you would do better on Ubuntu forums at ubuntu.com because here there can be no discussion. Just a specific question and a definite answer. Whereas on the forums we can post back and forth. Jan 17, 2012 at 1:45
  • 1
    Rather than back and forthing can you just edit your question with the information of the steps you've done so far? Jan 17, 2012 at 1:58

3 Answers 3


Your instructions seem to be old, as far as I know glut is provided by the package freeglut3, to get it with the header files for development, install:

sudo apt-get install freeglut3-dev

freeglut3-devInstall freeglut3-dev

which should also pull in freeglut3Install freeglut3.

To have found this on your own, you could have done:

sudo apt-cache search glut

After you have installed package freeglut3-dev you can confirm it contains the needed GL files by issuing

dpkg -L freeglut3-dev

which will list contents of the package which include :

  • 1
    Also install sudo apt-get install libxmu-dev libxi-dev Sep 26, 2019 at 10:04
  • freeglut3-dev isn't getting installed. Getting this error: The following packages have unmet dependencies: freeglut3-dev : Depends: libgl1-mesa-dev but it is not going to be installed or libgl-dev but it is not going to be installed. Depends: libglu1-mesa-dev but it is not going to be installed or libglu-dev. E: Unable to correct problems, you have held broken packages.. Ubuntu 20.04.1. Any idea how to fix this?
    – Nav
    Dec 7, 2021 at 7:24
  • Thank you for the comment about apt-cache search. It great learning the tools to solve specific problems without having to sift through all of the documentation or man-pages (I like documentation, but it takes time which can be hard to carve out). Sep 20, 2022 at 15:38

To install OpenGL libraries:

sudo apt-get install mesa-utils

To install freeGlut:

sudo apt-get install freeglut3-dev

Enter the following COMMANDS using Terminal:

sudo apt-get install aptitude
sudo aptitude install freeglut3-dev

Additional Notes: If computer asks you if you accept its solution that freeglut3-dev shall NOT be installed due to dependencies, enter "n" to signify "NO".

The computer shall then notify you regarding the downgrade packages action to resolve the dependencies problem. Enter "Y" to signify "YES".

I hope this helps you too.

Thank you.

You must log in to answer this question.

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