Install QEMU, gcc, gdb and libc6 with your favorite Linux distribution's package management utility.
sudo apt-get install qemu build-essential nasmIf you've decided to install a 64-bit os, you will need to follow the instructions to get the osdev-crosscompiler-i586-elf cross compiler package. (Qemu provides a 32-bit machine.) http://wiki.osdev.org/GCC_Cross-Compiler_on_Debian_Linux
sudo yum install qemu gcc gdb nasm glibc-devel glibc-headers
cd build
make