≡ Menu

HowTo: Ubuntu Linux Install Kernel Source Code And Headers

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:
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 
Share this tutorial on:
{ 7 comments… add one }
  • DivyansOctober 14, 2012, 12:52 pm

    Gr8! Thanks..

  • JCDMarch 20, 2013, 7:34 pm

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

  • rootApril 16, 2013, 2:26 pm


  • daveMay 29, 2014, 3:20 pm

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

    • doesn't matterSeptember 1, 2014, 3:16 pm

      you can find those under /usr/src/

  • UmerApril 22, 2015, 6:39 pm

    unable to connect to error while executing apt-get source command

Security: Are you a robot or human?

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">

   Tagged with: , , , , , , , , , , , ,