Originally Posted by jfernandez1977
I tried to download packages using other machines and try to compile, but when I tried to make gcc, it complained c++ compiler is missing.
By "packages" I meant .rpm files and I meant the .rpm file including the gcc c++ compiler, plus all the other rpm files that one depends on.
Then, if it were Fedora, you could use the rpm command to install those. In the Red Hat you have, I don't know whether such things are that similar to Fedora.
You should stop trying to install ANYTHING from source code until you have successfully installed a compiler (from a .rpm file)
Even before looking for the right .rpm files, check the man page on the rpm command, to make sure you have it and to find out the basics of how to use it.
It is possible you have or can setup a "local repository" (such as an install DVD) for yum and can configure yum to use only the local repository, not any online repository. You can find instructions online. That is all beyond my own abilities to figure out without a lot of "try and see" and at the moment I don't have admin rights on any system using yum. But maybe you can find online instructions clearer than the ones I found with a minimal google search.
AFTER you have installed (from .rpm file) a gcc version that is supported in your version of redhat, you may want to give more thought to why you want a newer version than that. gcc is designed such that a careful sysadmin can make multiple versions of gcc independently available on the same system. Toward that end, you could use the supported version installed from the .rpm file to install the newer version from source from the .gz file. Then you would have both.
But since you aren't expert enough to already know everything I just explained, I have to doubt that you are expert enough to make effective use of a gcc version that is different from the one officially supported by your version of redhat. Why do you want that specific gcc version?