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

by on July 26, 2008 · 25 comments· LAST UPDATED November 25, 2013

in , ,

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?

Tutorial details
DifficultyEasy (rss)
Root privilegesYes
Requirementsyum
Estimated completion time5m
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.

Installation

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 - 2.17.50.0.6-6.el5.i386 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:0.0.1.2008.03.19.rh1-1.el5 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.

Verification

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
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

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

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 25 comments… read them below or add one }

1 Alfredo Alfonzo June 16, 2009 at 6:40 pm

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

Best regards,
Alfredo

Reply

2 Arlindo April 29, 2012 at 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

Reply

3 Unca Alby August 3, 2014 at 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.

Reply

4 Jean-Denis Muys June 30, 2009 at 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?

Reply

5 nixCraft June 30, 2009 at 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'

Reply

6 Bruce Edwards August 25, 2014 at 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.

Reply

7 Andy Park July 30, 2009 at 1:26 pm

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

Reply

8 Hades August 3, 2009 at 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!!

Reply

9 Gribblebum May 7, 2012 at 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…
[code]
yum –enablerepo=c5-media groupinstall Development Tools’
[/code]

Reply

10 Onabolu September 16, 2009 at 6:42 pm

works perfectly. thanks a great deal

Reply

11 Jack October 18, 2009 at 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?

Reply

12 Trace January 1, 2010 at 12:11 am

hi,Guy.
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?

Reply

13 Gribblebum May 7, 2012 at 12:41 am

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

Reply

14 nixCraft January 1, 2010 at 4:58 am

Run

yum clear all

Reply

15 Andrei March 23, 2010 at 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 :(

Reply

16 Jim Spinner July 19, 2010 at 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
Jim

Reply

17 Kevin S January 28, 2011 at 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

Reply

18 Kerry Talbot April 17, 2011 at 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

Reply

19 ryan June 15, 2011 at 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:

[c5-media]
name=CentOS-$releasever – Media
baseurl=file:///media/CentOS/
file:///media/cdrom/
file:///media/cdrecorder/
gpgcheck=1
enabled=1
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?

Thanks

Reply

20 magicgg91 June 30, 2011 at 1:45 pm

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

Reply

21 David M September 4, 2011 at 2:34 pm

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

Reply

22 Michael S November 7, 2011 at 4:02 am

Perfect! Thanks!

Reply

23 Kingsley March 17, 2012 at 1:26 am

Thank you so much, You’ve made my day

Reply

24 Faisal Rehman November 25, 2013 at 10:20 am

Thank you for this helpful guide

Reply

25 mike November 20, 2014 at 8:04 pm

Thanks!

Reply

Leave a Comment

Tagged as: , , , , , , , , ,

Previous Faq:

Next Faq: