This is the way I did it, and hopefully should work for you as well.
Open terminal and login as root [or if you’d prefer, use sudo in every step.]
# cd /usr/src
# tar xvfj linux-2.6.31.tar.bz2
After it’s extracted remove the previous symlink.
# rm -rf linux
# ln -s /usr/src/linux-2.6.31 /usr/src/linux
Now your linux directory points to your newly extracted kernel tree source. If you want you can configure using your personal config, or I have uploaded my config which I will use in this guide. So you may skip next step of wgetting it. 😉