How to download quickly the kernel source code used on your Ubuntu

I am really sorry if this post is so shot and newbie but I will use these instructions on my next posts.

Try typing:

#> sudo -i

#> cd /usr/src

#> apt-get source linux-image-$(uname -r)

If fails complaining about dpkg-source, you need the debian package development tools.

Install it doing:

#> apt-get install dpkg-dev

and try to download the source again.

You can get using git. If you prefer this method check this page.

I am using root (sudo -i) on this example because next post I will compile some code that requires the right permission to run the example codes.