How do I install all developer tools such as GNU GCC C/C++ compilers, make and others, after installing CentOS or RHEL or Fedora Linux from the command line or shell prompt?

Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements yum
Est. reading time 5m
You need to install ‘Development Tools’ group on RHEL/CentOS/Fedora/Scientific/Red Hat Enterprise Linux. These tools include core development tools such as automake, gcc, perl, python, and debuggers which is required to compile software and build new rpms:

  1. flex
  2. gcc c/c++ compiler
  3. redhat-rpm-config
  4. strace
  5. rpm-build
  6. make
  7. pkgconfig
  8. gettext
  9. automake
  10. strace64
  11. gdb
  12. bison
  13. libtool
  14. autoconf
  15. gcc-c++ compiler
  16. binutils and all dependencies.


Open the terminal or login over ssh session and type the following yum command as root user:
$ sudo yum group install "Development Tools"
# yum groupinstall 'Development Tools'
Sample outputs:

Loading "fastestmirror" plugin
Loading mirror speeds from cached hostfile
 * base:
 * updates:
 * addons:
 * extras:
Setting up Group Process
Loading mirror speeds from cached hostfile
 * base:
 * updates:
 * addons:
 * extras:
Package make - 1:3.81-3.el5.i386 already installed and latest version
Package gettext - 0.14.6-4.el5.i386 already installed and latest version
Package binutils - already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package automake.noarch 0:1.9.6-2.1 set to be updated
---> Package frysk.i686 0: set to be updated
--> Processing Dependency: for package: frysk
--> Processing Dependency: glib-java >= 0.2.6 for package: frysk
---> Package autoconf.noarch 0:2.59-12 set to be updated
--> Processing Dependency: imake for package: autoconf
---> Package rcs.i386 0:5.7-30.1 set to be updated
---> Package strace.i386 0:4.5.16-1.el5.1 set to be updated
---> Package redhat-rpm-config.noarch 0:8.0.45-24.el5 set to be updated
---> Package elfutils.i386 0:0.125-3.el5 set to be updated
--> Processing Dependency: for package: elfutils
Transaction Summary
Install    105 Package(s)         
Update       0 Package(s)         
Remove       0 Package(s)         

Total download size: 127 M
Is this ok [y/N]: y
Downloading Packages:
(1/105): python-numeric-2 100% |=========================| 751 kB    00:12     
(2/105): xorg-x11-fonts-b 100% |=========================| 3.7 MB    01:03     
(3/105): pfmon-3.2-0.0609 100% |=========================| 656 kB    00:10     
(4/105): automake14-1.4p6 100% |=========================| 205 kB    00:03     
(5/105): libtool-1.5.22-6 100% |=========================| 680 kB    00:11     
(6/105): systemtap-0.6.2- 100% |=========================| 1.3 MB    00:22

Now you can compile and use any application on your system.


To display Gnu gcc/c/c++ compiler version type:
$ gcc --version
Sample outputs:

gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO

A sample c program

Create a text file called hello.c as follows using a text editor such as vi/vim:

/* hello.c - A sample C program for CentOS/RHEL */
#include <stdio.h>
int main(void)
 printf("Hello, world!\n");
 return 0;

To compile type:
$ make hello
To execute program type:
$ ./hello

This entry is 8 of 13 in the Linux GNU/GCC Compilers Tutorial series. Keep reading the rest of the series:
  1. Ubuntu Linux Install GNU GCC Compiler and Development Environment
  2. Debian Linux Install GNU GCC Compiler and Development Environment
  3. CentOS / RHEL 7: Install GCC (C and C++ Compiler) and Development Tools
  4. Download and Install C, C++ Compiler on Red Hat Enterprise Linux 5 (RHEL)
  5. Mac OS X: Install GCC Compiler with Xcode
  6. Where is My Linux GNU C or GCC Compilers Are Installed?
  7. HowTo: Compile And Run a C/C++ Code In Linux
  8. RHEL / CentOS Linux Install Core Development Tools Automake, Gcc (C/C++), Perl, Python & Debuggers
  9. HowTo Compiling C Program And Creating Executable File Under a Linux / UNIX / *BSD
  10. How To Install ncurses Library on a Linux
  11. Linux Find Out What Compilers Are Installed or Available On The System
  12. Linux Find Out GNU gcc Compiler Version Used To Compile Running Kernel
  13. Howto see output of C program in Linux or UNIX

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 26 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
26 comments… add one
  • Alfredo Alfonzo Jun 16, 2009 @ 18:40

    Thank you for your suggestions ! work perfectly for me. I really appreciate it !

    Best regards,

    • Arlindo Apr 29, 2012 @ 19:56

      How can I find wich packages I am installing in group install? I want to now wich packages I am installing before entering “group install ….” command.
      CentOS 5 and CentOS 6

      • Unca Alby Aug 3, 2014 @ 4:53

        Hi Arlindo; when you run “yum install” it will print out a complete list of everything it wants to install, then ask you for confirmation.

  • Jean-Denis Muys Jun 30, 2009 @ 9:06

    This is so nice… but my target machine is not connected to the internet. What would I have to copy over it in order for yum groupinstall ‘Development Tools’ to work?

    I expect I need at least to download the .rpm for all the packages listed in the group. So the double question:
    – where to download them from?
    – where to copy them to?

    • 🐧 nixCraft Jun 30, 2009 @ 9:22

      Use DVD via yum command, just open /etc/yum.repos.d/CentOS-Media.repo and make sure enabled=1. To use this repo, put in your DVD and use it with the other repos too:
      yum --enablerepo=c5-media groupinstall Development Tools'

    • Bruce Edwards Aug 25, 2014 @ 10:07

      You need to make sure there is internet connected to your system first and then from SU enter: dhclient.

      This will get an IP for centos.

  • Andy Park Jul 30, 2009 @ 13:26

    Thank You!!
    Your’s Document is very nice! My Problem.

  • Hades Aug 3, 2009 @ 19:35

    Hi Andy Park:

    I am new to CentOS Linux as well, please help me!!

    I am trying to install a router to the CentOS but it requires me to install C compiler first, I have tried to input the command of “yum groupinstall ‘Development Tools’. However, I am receiving the following error message:

    “Error: Could not retrieve mirrorlist error was [Errno 4] IOError:
    Error: Cannot find a valid baseur1 for repo: base

    What does that mean? Can you or anyone please help me to install the C compiler?

    Any common are appreciated!!

    • Gribblebum May 7, 2012 @ 0:40

      It’s telling you that it can’t access the mirror you’ve chosen, more than likely, the network isn’t up and running, or it’s not connectable. The easiest solution is to download the DVD(s) and install from them…
      yum –enablerepo=c5-media groupinstall Development Tools’

  • Onabolu Sep 16, 2009 @ 18:42

    works perfectly. thanks a great deal

  • Jack Oct 18, 2009 @ 15:13

    Looks good, but what if I’m not able to connect directly to a network anymore? How could I down load the appropriate RPMs and do this install off line?

  • Trace Jan 1, 2010 @ 0:11

    My OS is CentOS 5 and I have type : yum groupinstall ‘Development Tools’,But at the end of it return some errors like:
    -----------------------------------cut-off line---------------
    Transaction Check Error:
    file /usr/share/man/man1/Xserver.1x.gz from install of xorg-x11-server-Xvfb-1.1.1-48.67.el5 conflicts with file from package xorg-x11-server-Xnest-1.1.1-48.26.el5
    file /usr/share/man/man1/Xserver.1x.gz from install of xorg-x11-server-Xvfb-1.1.1-48.67.el5 conflicts with file from package xorg-x11-server-Xorg-1.1.1-48.26.el5

    Error Summary
    -----------------------------------cut-off line---------------

    Can you help me,plz?

    • Gribblebum May 7, 2012 @ 0:41

      you should do an update before hand with the command ” yum update “

  • 🐧 nixCraft Jan 1, 2010 @ 4:58


    yum clear all

  • Andrei Mar 23, 2010 @ 22:34

    Hello everyone,
    I really need help with this i’ve treid EVERYTHING doe the last two days at least 5-6 hours / day.
    I’m trying to install a newtwork driver r8168 because the one that came with the installation r8169 is messing up bad and i cannot access internet.

    I’ve tried yum –enablerepo=c5-media groupinstall Development Tools’
    but I am getting the same errror as Hades :

    “Error: Could not retrieve mirrorlist error was [Errno 4] IOError:
    Error: Cannot find a valid baseur1 for repo: base

    I need to get gcc installed.
    Ive tried downloading it in tar.bz2 and tried installing it that way but still no luck. All the packages that i have found when i run them they try to go out on the internet to get necessary files.

    I’ve never been more frustrated in my life please help :(

  • Jim Spinner Jul 19, 2010 @ 16:22

    yum — disablerepo=\* –enablerepo=c5-media groupinstall ‘Development Tools’
    to disable checking on-line and only use cdrom.
    you need to have your cdrom mounted in the correct directory check with /etc/yum.repos.d/CentOS-Media.repo

  • Kevin S Jan 28, 2011 @ 14:22

    Hi, I successfully installed Developement Tool but when I am trying to install Ogg codec I get an error which says

    root@vid [~]# cd /usr/src
    root@vid [/usr/src]# svn checkout ogg
    Checked out revision 17790.
    root@vid [/usr/src]# cd ogg
    root@vid [/usr/src/ogg]# ./
    checking for autoconf…
    checking for automake 1.11 or later… no
    checking for aclocal 1.11 or later… no

    You must have automake installed to compile libogg.
    Download the appropriate package for your distribution,
    or get the source tarball at
    root@vid [/usr/src/ogg]#

    and when I try to install automake it says.

    Package automake16-1.6.3-8.el5.1.noarch already installed and latest version
    Package automake17-1.7.9-7.el5.2.noarch already installed and latest version
    Package automake14-1.4p6-13.el5.1.noarch already installed and latest version
    Package automake15-1.5-16.el5.2.noarch already installed and latest version

    I am not what going on but your help will be appreciated. I am working on it for long hrs.

    Thanks a lot

    • Kerry Talbot Apr 17, 2011 @ 3:11

      I am running CentOS 5.6 on an enterprise server and on a lab pc for testing various SIP enable open source systems, such as Asterisk.
      You must have selected the gcc options from the install, there is a button to select install packages now, be sure to select all the components that start with gcc, you will need to look in the developer tools section. If you already have gcc then a lot time will be saved, if not then you will have a lot do, the initial install for Linux is very critical.

      1) Download gcc from then select one of the mirror sites. You could see a lot of individual down loads, however the gcc-4.6.0 is the largest download and has everything, and I do mean everything. Start to completion if ti goes right will take around 2 hours or so depending on the server class.

      2) Untar the download, ex. tar -jxvf filename.gz.bz2, -j is needed to untar the bz2 type tar ball, -zxvf will be used for the other files.

      3) Once untarred there are several instruction files, one in particular will get you going, prerequesites.html as well as other docs.

      4) Pay close attention to the files/libraries needed, gmp, mpc, and mpfr are needed for the gcc to complete. The incredibly nice thing is that the gnu gcc developers made it easy. Look at the alternative install statement you can untarr the gmp, mpc, and mpfr. Then put them into a directory named gmp, mpc, and mpfr in the gcc-4.6.0 directory that was created when you untarred the gcc compiler/s, there is more than one is the gcc complete.

      5) A quick look at gcc-4.6.0 directory and verify the untarred files are in their respective directories. Note: untarring the gmp, mpc, and mpfr will put them in their own directory, just use the mv command if necessary to get them into those gmp, mpc. and mpfr directories under the gcc-4.6.0 directory. The reason for this is that the doc states that the gcc gnu team has the install worked out for you if the gmp, mpc, and mpfr directories are there. If you have done all this then just run the ./configure from the gcc-4.6.0 directory, when that completes, then type make, after that you will have around 2 hours to kill for that to complete.
      Good luck, I hope this helps

  • ryan Jun 15, 2011 @ 18:46

    Hi guys,

    I know this thread is kinda of old but I was hoping someone could help me out.
    So I am trying to install the CentOS development tools from the DVD because I do not have internet on this machine. Following previous suggestions I edited my etc/yum.repos.d/CentOS.Media.repo file and changed “enabled=0” to “enabled=1” and mounted my dvd to /media/CentOS by running the following command:

    mkdir /media/CentOS
    mount /dev/hdd /media/CentOS

    Then I ran the following command to install the development tools from DVD:

    yum –disablerepo=\* –enablerepo=c5-media groupinstall ‘Development Tools’

    but I got this message:

    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    Could not retrieve mirrorlist error was
    [Errno 4] IOError:

    Cannot find a valid baseurl for repo: base
    I tried editing my Centos.mdeia.repo file again and changed “gpgcheck=1” to “gpgcheck=0” but that didn’t help either.

    Here is a copy of my CentOS-Media.repo without the comments at the beginning:

    name=CentOS-$releasever – Media
    gpgkey= HYPERLINK “/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5″file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

    Any suggestions as to what I should do next?


    • magicgg91 Jun 30, 2011 @ 13:45

      I have the same problem, I follow the recommandations but I still get the same error message.
      Have you find a solution ?

  • David M Sep 4, 2011 @ 14:34

    Thanks, exactly what I was looking for. Good guide.

  • Michael S Nov 7, 2011 @ 4:02

    Perfect! Thanks!

  • Kingsley Mar 17, 2012 @ 1:26

    Thank you so much, You’ve made my day

  • Faisal Rehman Nov 25, 2013 @ 10:20

    Thank you for this helpful guide

  • mike Nov 20, 2014 @ 20:04


  • Maharajan Raja Feb 5, 2016 @ 13:43

    Thank you so much . Am new to linux . It is very simple steps to install , compile and execute c Code in Linux environment.

    Thank you :)

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum