I have Ubuntu 12.04 installed. I just installed the gcc-4.6 and g++-4.6 packages from the same OS media.

However, when I attempted to install the build-essential package from the same OS media, it says gcc is not installed. The version it is require >= 4.4 and the version installed = 4.6.

How do I resolve this issue?

2 Answers 2


Try typing this at a terminal:

which gcc

If nothing comes back, then GCC is probably not in your path variable. Type:

sudo updatedb
locate gcc

If nothing comes up, then there is no executable called gcc on your machine. Reinstall GCC.

If you do get the location of an executable called gcc, such as /usr/bin/gcc, then add the directory to your path:


Obviously use what came back on your system. See if that fixes things. If it does, you can make the PATH change permanent by putting that line in your ~/.bashrc file.

  • You're welcome. If this works for you, make sure to mark the answer as accepted Commented May 8, 2013 at 23:02
  • Sorry I could not finish the comment.Thanks dude, you are really helpful. I created a symbolic link gcc in /usr/bin of gcc-4.6. and I am able to see it by which command and also I can execute gcc. But the problem is still there. please help.
    – user285825
    Commented May 8, 2013 at 23:03
  • That's very strange. Does your machine have internet access that can get to the official package repositories? Also, do you need GCC 4.6 or can you use 4.7? If you can, try isntalling the GCC and build-essential from the official repositories and see if it has the same error. The OS disc sometimes has really old packages in it. Commented May 8, 2013 at 23:21
  • Seems like the package gcc-4.6 is installed, but the gcc is not. Anyway, build-essential should pull it in. Are you trying to install it by apt-get?
    – grimpitch
    Commented May 8, 2013 at 23:25
  • @grimpitch No he is using the OS media. If possible, I would recommend using the package repositories. Commented May 8, 2013 at 23:28

I think I had the same problem.

which gcc

returns nothing, however,

whereis gcc

does return a path: /usr/bin/gcc

The fix for this is to reinstall build-essential.

sudo apt-get update
sudo apt-get install --reinstall build-essential

Now, the following command:

which gcc

returns this:


Hope this helps.

You must log in to answer this question.

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