Download or install C, C++ compiler on Red Hat Enterprise Linux 5 (RHEL)
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
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Other Helpful FAQs:
- Where is my Linux GNU C or gcc compiler installed?
- Add a package group using up2date command
- Howto Compiling C program and creating executable file under Linux / UNIX / *BSD
- Howto see output of C program in Linux or UNIX
- Linux Failure (4322): Configuration Initialization Failed - Error and Solution
Discussion on This FAQ
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: c compiler for RHEL, CentOS, c_compiler, enterprise_linux, fedora_linux, gcc_compiler, gnu_compiler_collection, gnu_gcc, install_rpm, production_server, red_hat_enterprise, rpm_command, system-config-packages_command, yum_command



August 5th, 2007 at 3:18 am
i wont compiler c linux redhat as4
August 17th, 2007 at 2:12 pm
Its Great to use needed this kind of blogs
September 2nd, 2007 at 5:42 am
Very use full thanks lot
November 22nd, 2007 at 4:47 pm
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!
December 20th, 2007 at 7:46 am
thanks for the info!
March 31st, 2008 at 11:27 am
why registration is Required???? if it is free
u will get hit more if u remove this step