You said that you are new to Linux, so it is possible that you already have gcc installed, even if it is an older version. You should act as colucix told you, but if you are desperate enough to build from sources, then these are the basic steps for most cases (not only for the mentioned packages):
- go to the destination directory
- unpack the source tarball to the destination directory (tar -jxf path/package.tar.bz2)
- go into the sources directory
- read the README and INSTALL files, if there are any
- run configure (./configure)
- run make (make)
- switch to root user and install (make install)
Linux Archive