If you want to install a program by compiling from source, this usually begins by downloading a tarball and extracting it using the tar utility. If the file extension is tar use
tar -xvvf file.tar, if it is gz use
tar -xzvf file.tar.gz, for bz2 use
tar -jxvf file.tar.bz2.
The GNU Compiler Collection (GCC), which includes compilers for C, C++, Fortran and other programming languages. In order to be able to compile programs you need to have GCC and some libraries installed. In ubuntu, you'll install it typing:
sudo apt-get install build-essential
Usually, to compile a C program to binary myprogram you type:
gcc -o myprogram myprogram.c
or, for C++
g++ -o myprogram myprogram.cpp
However, most programs that you would download need more than that. They need some configuration, detect dependencies, among other things. Usually you'll find a readme file that carries you through the steps of installation. Typical these would be
configure; make; sudo make install.
What happens often is that you get back some error that you miss some library that you've never heard of. In some cases you would spend hours searching forums in order to find out in which package the library is located. A simpler way to find out you in which package your library is located is:
If you use the rpm package manager, similarly you can use: