the different versions will be in the repos BUT under a slightly different name
just do a search for gcc and the others WILL be on the list
to use "alternatives" or to not use "alternatives" that is the question ....
some like it i do not
in /usr/bin there should be a link from /usr/bin/g++4.7 to /usr/bin/g++
or what ever the default it
i use a set up script
YOURS WILL BE A BIT DIFFERENT depending on just WHAT you have installed
-- my gcc 4.6 script called " set_gcc_to_4.6.sh" ---
Code:
#!/bin/bash
rm /usr/bin/cpp
ln -s /usr/bin/cpp-4.6 /usr/bin/cpp
echo ln -s cpp-4.6 cpp
rm /usr/bin/gcc
ln -s /usr/bin/gcc-4.6 /usr/bin/gcc
echo ln -s gcc-4.6 gcc
rm /usr/bin/cc
ln -s /usr/bin/gcc-4.6 /usr/bin/cc
echo ln -s gcc-4.6 cc
rm /usr/bin/g++
ln -s /usr/bin/g++-4.6 /usr/bin/g++
echo ln -s g++-4.6 g++
rm /usr/bin/c++
ln -s /usr/bin/g++-4.6 /usr/bin/c++
echo ln -s g++-4.6 c++
rm /usr/bin/gcov
ln -s /usr/bin/gcov-4.6 /usr/bin/gcov
echo ln -s gcov-4.6 gcov
use one for EVERY version
and edit the linking and removing to YOUR system
then as root run the script for the one you want
you will find that most software will need a bit of help to build in gcc4.7
it is SO NEW that most things have not caught up to it yet
4.5 is most likely the version you will most use