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
Answer from gareth_bowles on serverfault.comI'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.
Videos
The easiest method by far is to make use of a binary build that's provided through a YUM repository. One such option would be to use the hop5.in repository. Specifically this page: gcc - Various compilers (C, C++, Objective-C, Java, ...). They're providing 4.8.2 which should work with CentOS 6.3 or 6.4. You might want to do an update prior:
$ sudo yum update
The other option would be to make use of the Developer Toolset, specifically the bundled version provided by Scientific Linux.
- http://linux.web.cern.ch/linux/devtoolset/
Following the installation instructions you'll basically do the following 2 steps:
add repositories$ sudo wget -O /etc/yum.repos.d/slc6-devtoolset.repo \
http://linuxsoft.cern.ch/cern/devtoolset/slc6-devtoolset.repo
$ wget -O /etc/yum.repos.d/slc5-devtoolset.repo \
http://linuxsoft.cern.ch/cern/devtoolset/slc5-devtoolset.repo
install devtoolset
$ sudo yum install devtoolset-2
Update #1
The hop5.in YUM repository appears to have been removed, so the only recourse is to make use of the devtoolset method highlighted above.
Additional examples for installing via devtoolset are highlighted in this GitHub Gist: Installing gcc 4.8 and Linuxbrew on CentOS 6.
Red Hat Software Collections comes with GCC 4.9 you may look at enabling that channel.
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