≡ Menu

RHEL / CentOS Linux Install Core Development Tools Automake, Gcc (C/C++), Perl, Python & Debuggers

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 a shell prompt?

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 command as root user:
# yum groupinstall 'Development Tools'
Sample outputs:

Loading "fastestmirror" plugin
Loading mirror speeds from cached hostfile
 * base: mirror.steadfast.net
 * updates: dist1.800hosting.com
 * addons: centos.mirrors.tds.net
 * extras: dist1.800hosting.com
Setting up Group Process
Loading mirror speeds from cached hostfile
 * base: mirror.steadfast.net
 * updates: dist1.800hosting.com
 * addons: centos.mirrors.tds.net
 * extras: dist1.800hosting.com
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: libgcj.so.7rh 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: libdw.so.1 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

Share this tutorial on:

Like this? Follow us on Twitter OR support us by using Patreon

{ 26 comments… add one }
  • Alfredo Alfonzo June 16, 2009, 6:40 pm

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

    Best regards,

    • Arlindo April 29, 2012, 7:56 pm

      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 August 3, 2014, 4:53 am

        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 June 30, 2009, 9:06 am

    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 June 30, 2009, 9:22 am

      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 August 25, 2014, 10:07 am

      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 July 30, 2009, 1:26 pm

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

  • Hades August 3, 2009, 7:35 pm

    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 http://mirrorlist.centos.org/?release=5&arch=i386&repo=os 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, 12:40 am

      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 September 16, 2009, 6:42 pm

    works perfectly. thanks a great deal

  • Jack October 18, 2009, 3:13 pm

    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 January 1, 2010, 12:11 am

    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, 12:41 am

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

  • nixCraft January 1, 2010, 4:58 am


    yum clear all

  • Andrei March 23, 2010, 10:34 pm

    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 http://mirrorlist.centos.org/?release=5&arch=i386&repo=os 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 July 19, 2010, 4:22 pm

    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 January 28, 2011, 2:22 pm

    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 http://svn.xiph.org/trunk/ogg/ ogg
    Checked out revision 17790.
    root@vid [/usr/src]# cd ogg
    root@vid [/usr/src/ogg]# ./autogen.sh
    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 ftp://ftp.gnu.org/pub/gnu/
    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 April 17, 2011, 3:11 am

      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 http://www.gnu.org 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 June 15, 2011, 6:46 pm

    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 http://mirrorlist.centos.org/?release=5&arch=i386&repo=os 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 June 30, 2011, 1:45 pm

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

  • David M September 4, 2011, 2:34 pm

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

  • Michael S November 7, 2011, 4:02 am

    Perfect! Thanks!

  • Kingsley March 17, 2012, 1:26 am

    Thank you so much, You’ve made my day

  • Faisal Rehman November 25, 2013, 10:20 am

    Thank you for this helpful guide

  • mike November 20, 2014, 8:04 pm


  • Maharajan Raja February 5, 2016, 1:43 pm

    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 :)

Security: Are you a robot or human?

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">

   Tagged with: , , , , , , , , ,