Page 1 of 1

Install g++ to CentOS 6.2

Posted: 23 Nov 2012, 19:44
by dedanna1029
It is strange, but there is a certain way one must go about it for CentOS 6.2. If you type in "yum install g++", or "yum install gcc-g++", it won't find it. There is a way, however, where it will find it, and it will install. Reasons remain unknown as to why this is, but I thought I'd pass it along. What you need to do is:

Code: Select all

su
password
yum install gcc-c++ compat-gcc-32 compat-gcc-32-c++

It will NOT find compat-gcc-32 or compat-gcc-32-c++, but it WILL find gcc-c++, which is exactly what you need for g++.

I found it here, while searching for an rpm for g++ (which isn't in the repos).

Code: Select all

.:[ [email protected] : 11:31:20 : ~ ]:.:) yum install gcc-c++ compat-gcc-32 compat-gcc-32-c++

<snip for unnecessary mirror info>

mirror.spro.net already timed: 1.0922369957
 * mirror.spro.net : 1.092237 secs
 * updates: mirrors.greenmountainaccess.net
C6.2-base                                                                                             | 3.7 kB     00:00     
C6.2-centosplus                                                                                       | 3.5 kB     00:00     
C6.2-contrib                                                                                          |  951 B     00:00     
C6.2-extras                                                                                           | 3.5 kB     00:00     
C6.2-updates                                                                                          | 3.5 kB     00:00     
adobe-linux-i386                                                                                      |  951 B     00:00     
base                                                                                                  | 3.7 kB     00:00 ...
centosplus                                                                                            | 3.5 kB     00:00     
contrib                                                                                               |  951 B     00:00     
extras                                                                                                | 3.5 kB     00:00 ...
linuxtech-release                                                                                     | 1.3 kB     00:00     
updates                                                                                               | 3.5 kB     00:00

<snip unnecessary info>

Dependencies Resolved

=============================================================================================================================
 Package                             Arch                     Version                         Repository                Size
=============================================================================================================================
Installing:
 gcc-c++                             i686                     4.4.6-4.el6                     base                     4.3 M
Installing for dependencies:
 libstdc++-devel                     i686                     4.4.6-4.el6                     base                     1.5 M

And there you go. :) The repos were showed so you would know which ones are needed. Now you will have g++ to install your compiled proggies with. :)