Please follow this method and you can surely get gcc working:
1.If you are having the RHEL5 DVD, then copy the Server directory from the DVD to your hard disk (say /Server)
2.then cd /Server.
3.rpm -ivh createrepo<press the tab key> and enter.
This will install createrepo package.
createrepo -v /Server.
This will create the repositories, (almost 1200 RPMs are there).
A blank screen appears, now type:
6.Save this file.
7.now type, yum clean all
yum install gcc
8.This will install gcc and its dependencies.
9.Make sure you have autoconf and automake packages, which are in the /Server directory.
Last edited by saagar; 05-01-2009 at 10:52 AM.