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
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop











{ 21 comments… read them below or add one }
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 .
You just saved my life! Thank you so much for the info…
Thank you!
Excellent work… Your help is really appreciate………….
it helped me a lot
Thanks….save me tons of time,, :)
thank u very much for the help
This tutorial helped me much. Thanks
1000 Thank Yous.
thx, i just installed it, much appreciated.
The smallest question “what is the gcc version” and u had it…Thanx a ton!
when I install faad2-2.7 in Optiplex 780 in fedora 13 window the compiler display
shime@localhost softwares]$
[shime@localhost softwares]$ cd faad2-2.7
[shime@localhost faad2-2.7]$ su
[root@localhost faad2-2.7]# ./configure
hecking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking for gawk… gawk
checking whether make sets $(MAKE)… yes
checking build system type… i686-pc-linux-gnu
checking host system type… i686-pc-linux-gnu
checking for style of include used by make… GNU
checking for gcc… no
checking for cc… no
checking for cl.exe… no
configure: error: no acceptable C compiler found in $PATH
See `config.log’ for more details.
please help me how to solve this problem????
hi, when i type the command ‘ yum install gcc’ , i got a reply as ‘you need to be a root to perform this command…”
what does it mean??
It means you need to be superuser by using the command:
su
Then it will prompt for a password, then you will be able to install using the same command.
As an alternative log in as the root user.
when i giv the command “yum install gcc”, it says i need to be a root to perform this command… wht shld i do??
I have centos installed,
ls -l glibc-*
-rw-r–r– 1 root root 4596084 Jul 25 15:31 glibc-2.5-34.i386.rpm
-rw-r–r– 1 root root 5459594 Jul 25 15:31 glibc-2.5-34.i686.rpm
-rw-r–r– 1 root root 17249412 Jul 25 15:31 glibc-common-2.5-34.i386.rpm
error when install rpm packet.
rpm -ivh glibc-2.5-34.i386.rpm
error: glibc-2.5-34.i386.rpm: rpmReadSignature failed: region trailer: BAD, tag 15872 type 2047 offset 28672 count 4238
error: glibc-2.5-34.i386.rpm cannot be installed
error when install tar.gz
configure: error: no acceptable C compiler found in $PATH
]# gcc
-bash: gcc: command not found
(gcc not install).
How to install gcc ?
thx a lot
I had the need to be in root to perform this command error so I thought Id share the solution I found (im using centOS). I used the command – sudo yum install gcc-c++
BUT that is for c++ compiling so for C use sudo yum install gcc
It seems that you need to put sudo in front of the command to use root 0.o maybe.
Sudo will raise the priv level of the currently logged in user to execute the task listed after it (you can also find out more with: man sudo), it is like right clicking in Windows and selecting to run as administrator.
I have several error to comiple SPEC2006. can you help
specmake: icc: Command not found
Error with make ‘specmake build’
specmake: *** [spec.o] Error 127
Command returned exit code 2
Error with make!
how i get my c++ compiler in linux please give me steps n how i will compile my program
hey what should we give for password? it’s not taking any characters
i want to clean gcc4.3 in ubuntu and install gcc2.96 .
i dont know how do .
please help me .
thanks