Q. I have Red hat enterprise Linux 5 installed on one of the production server. However there is no c compiler installed. I need to compile few applications on this box. How do I install C or C++ compiler on Red Hat Enterprise Linux 5? Where can I get / download compile package?
A.In order to compile and use c/c++ under Linux you need following packages
=> autoconf : GNU's Autoconf is a tool for configuring source code and Makefiles.
=> make/automake : A GNU tool for controlling the generation of executables and other
non-source files of a program from the program's source files.
=> GNU GCC C compiler (gcc) : The gcc package contains the GNU Compiler Collection version 4.1
=> GNU GCC C++ compiler (gcc-c++): This package adds C++ support to the GNU Compiler Collection.
You have total 3 options to download and install GCC compiler under Redhat / CentOS / Fedora Linux:
[a] Use GUI tool
[b] Install rpm from CDROM/DVD
[c] Download and install compiler from RHN over internet
Option # 1: Use GUI tool
Use GUI tool called system-config-packages to install gcc. Just type the following command and select gcc and above packages:
$ system-config-packages &
Option # 2: Install rpm from CDROM/DVD
Mount your CD/DVD and install following packages using rpm command.
# rpm -ivh gcc*
Option # 3: Download and install compiler from RHN over internet
You can download and install packages using RHN and yum command:
# yum install gcc gcc-c++ autoconf automake
- Email FAQ to a friend
- Printable version
- Rss Feed
- Last Updated: 12-21-07

{ 13 comments… read them below or add one }
i wont compiler c linux redhat as4
Its Great to use needed this kind of blogs
Very use full thanks lot
This really is one of the clearest and most helpful answers to a tech question that I’ve ever seen. I’ve just taken on a RHEL v5 server and needed gcc installed – ten minutes after finding this site, I have gcc 4.1.2 installed. This must have saved me a few hours of searching and reading install instructions . . .
I found your site through Google but have now bookmarked it and I’ll be back!
thanks for the info!
why registration is Required???? if it is free
u will get hit more if u remove this step
how would i install c language
hello
thank u
thanks for the info! It is very useful!
I have problem in installing *.tar.gz file on my machine…
replay must is very argent for me…
in reading your blog i’m as confused and lost as ethernet is to phone transmission; i installed mandriva free and that is the os i’m using at present; i then foolishly bought their powerpack, thinking it would solve the problems that mandriva one was presenting to me; having downloaded it and installed it due to my ignorance in handling this os i made it unusable; i then repeatedly tried to reinstall it only to find that the operating system will not load giving me an error message: fatal error message which i cannot overcome, yet.
can you help?
is there anyone there who knows what i can do?