If you've just installed Linux, there was a kernel with your distribution. Why should you recompile it?

Most often there is a reason for you to compile your own kernel. First, you might have some hardware not supported in your current kernel, forcing you to compile your own.

Second, you might want to compile your own kernel because the one you have has too much hardware support compiled in. As an example, if you have a system with only (E)IDE harddisks, you don't your kernel to support several SCSI controllers. The same goes for odd hardware like CDROM:s connected to soundblaster sound cards and other similar things.

Recompiling your kernel will make it smaller, taking upp less memory. On todays computers that's often not a problem, since they have enough memory anyway.

Security is another aspect. Sometimes some security related bug is found in the kernel code, and a fix is released as a patch or in the next kernel release. When you recompile your kernel your computer won't be vulnerable to that security problem any more.

OK, so now I've decided to compile my own kernel, what do I need?
A C compiler
You need a c compiler with friends. To be more specific, you need the GNU C compiler, gcc. Try gcc at your command line. If you get the message gcc: No input files you have gcc. Make sure it's not historical. If you don't have any gcc, find out how to install it.
 

You need (of course) the Linux kernel source, availiable at a very large number of ftp sites around the world. Try pointing your web browser at http://www.kernel.org. Try finding a kernel archive in your country by appending your country code (Ie 'se' for Sweden, 'us' for the USA, 'fi' for Finland..) after the www, making the URL something like www.us.kernel.org . That will take less international bandwidth, and that's always a good thing.

Once you've got the source (that will take some time for a modem user, since it's quite big. At the moment I'm writing this, the 2.2.10 kernel is 13 Megabytes) you should unpack it. Preferably in /usr/src since that's the place it should be. So.. get the rights you need and go to /usr/src and execute tar -zxvf /foo/bar/linux-2.2.10.tar.gz. That will take some time.

In my humble opinion, when I say "get the rights you need" above, I don't mean you should get root since that's a user you shouldn't use when it's not absolutely neccessary. Fewer things broke that way.. So, it's better if you check the rights needed and make yourself a member of the correct group.

Time.
Compiling the kernel will take some time, it's quite a lot of source code. Depending of your computer, and how much you include in your kernel configuration it may take anything from less than 5 minutes to a day or two.

So, when you're done with your kernel configuration; set the whole thing off and go get yourself a nice cup of tea, or something