Where is my Linux GNU C or gcc compiler installed?

by Vivek Gite on November 14, 2006 · 8 comments

Q. Where is my GNU C compiler? Where does the GNU C (gcc) compiler reside in the CentOS Linux installation? How do I install if it is not installed by default?

A. Use which command to locate c compiler binary called gcc. Usually it is installed in /usr/bin directory.

Type following command to see Linux C Compiler location:

$ which gccOutput:

/usr/bin/gcc

Display gcc version:

$ gcc -vOutput:

Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=x86_64-redhat-linux
Thread model: posix
gcc version 3.4.6 20060404 (Red Hat 3.4.6-3)

Use up2date or yum or apt-get command to install gcc and required libs:

If you are using Red Hat Enterprise Linux, type the command:

# up2date gcc

If you are using CentOS/Fedora Core Linux, type the command:

# yum install gcc

If you are using Debian /Ubuntu Linux , type the command:

$ sudo apt-get install gccOR# apt-get install gcc

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 8 comments… read them below or add one }

1 Jim January 13, 2009

Hi this help is awesome it helps me a lot , i was looking for this commands in pages of my country(peru) but i didn’t find anything . thanks a lot .

Reply

2 Ash August 22, 2009

You just saved my life! Thank you so much for the info…

Reply

3 Roger September 24, 2009

Thank you!

Reply

4 JAmesBondRobin October 24, 2009

Excellent work… Your help is really appreciate………….
it helped me a lot

Reply

5 xoerk May 17, 2010

Thanks….save me tons of time,, :)

Reply

6 sagar sukumar August 30, 2010

thank u very much for the help

Reply

7 Mohammad Osman Goni May 3, 2011

This tutorial helped me much. Thanks

Reply

8 Bob Ebbert December 13, 2011

1000 Thank Yous.

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 12 + 3 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: