Take the tour ×  So I came into my classrom Debian is installed,
and gcc 4.1. I want to install (compile from sources is an
option - I have time..) for my self GCC 4.7 and adress it in
bash as gcc anywhere. Is such thing possible and how to do it?
share|improve this question add comment  1 Answer  up vote 5
down vote accepted  Use the --prefix option with the configure
command.  I won't try to give a complete configure command here,
since GCC is one of those programs most often given complex
configuration options, but adding something like
--prefix=$HOME/my-gcc-4.7 will work. Upon installation, you will
get a tree under that directory containing things like bin/gcc.
Once it's built and installed, add $HOME/my-gcc-4.7/bin to the
head of your PATH, and suddenly it will become the default GCC.
share|improve this answer add comment  Your Answer