HowTo: Ubuntu Linux Install Kernel Source Code And Headers

by on July 8, 2009 · 5 comments· LAST UPDATED April 17, 2013

in

How do I install Linux kernel source with Ubuntu patches? How can I install Ubuntu Linux kernel source code tree for version 2.6.3x using command line options?

You need to use the apt-get command to install Linux kernel source code. Open the terminal and type the following commands to install Ubuntu Linux source code:
$ sudo apt-get update
$ sudo apt-get install linux-source

Sample outputs:

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  linux-source-2.6.32
Suggested packages:
  libncurses-dev ncurses-dev kernel-package libqt3-dev
The following NEW packages will be installed:
  linux-source linux-source-2.6.32
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 65.9MB of archives.
After this operation, 66.0MB of additional disk space will be used.
Do you want to continue [Y/n]? y
TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 5 comments… read them below or add one }

1 Divyans October 14, 2012 at 12:52 pm

Gr8! Thanks..

Reply

2 JCD March 20, 2013 at 7:34 pm

Thank you, after a few hours of frustration, these instruction did the trick.

Reply

3 root April 16, 2013 at 2:26 pm

s/sudp/sudo/

Reply

4 nixCraft April 17, 2013 at 9:06 am

Thanks for the heads up!

Reply

5 dave May 29, 2014 at 3:20 pm

Great, but what directory are the source files stored in?

Reply

Leave a Comment

Tagged as: , , , , , , , , , , , ,

Previous Faq:

Next Faq: