Yum will install rpm from it's repository.
So I don't understand why you want to avoid yum, it will solve dependencies and install them as well.
However, here is official RPM repository mirror (one of many): http://centos.arminco.com/5/os/i386/CentOS/
Here is list of all mirrors : http://www.centos.org/modules/tinycontent/index.php?id=30
You will need at least 3 RPMs:
- gcc-4.4.6-3.el6.i686.rpm
- gcc-c++-4.4.6-3.el6.i686.rpm
- libgcc-4.4.6-3.el6.i686.rpm
For compilation of C/C++ you will also need libstdc++, glibc, etc
When you run
yum install gcc
Everything is done
As you did not specified architecture I assume i386, but URL is very similar for x86_64:
http://centos.arminco.com/6/os/x86_64/Packages/
If you want to install it as a local user (or as a superuser)
GNU GSRC provides an easy way to do so
Link: http://www.gnu.org/software/gsrc/
After installation via bzr, simply do these:
./bootstrap
./configure --prefix=~/local
make -C gnu/gcc
(or make -C gnu/gcc MAKE_ARGS_PARALLEL="-jN" to speed up for a N-core system)
make -C gnu/gcc install
I'd recommend using yum localinstall rather than using the rpm command directly; that way you'll have the gcc package in your yum database so that it can keep track of updates. The command would just be:
yum localinstall /mnt/cdrom/CentOS/gcc-(whatever).rpm
You want to use something like rpm -ivh /mnt/cdrom/CentOS/gcc-(whatever).rpm. The command line options there are:
-i-- install (you can use-Uto install or upgrade, many just always use that)-v-- verbose output-h-- show hashmarks, a simplistic progress bar
Yum will figure out which package you mean if you type yum install gcc. That'll use your chosen repository, or the CD if you've got the correct repository installed (which you probably do). In general, yum is easier to use if you're not doing anything strange.