How to download the kernel source code of Ubuntu
Hi,
For the customer's requirement, we need to re-compile the kernel image of Ubuntu12.04, such as Linux-3.2.0-23.36. So would you please help to tell where I can download the kernel source code? The standard kernel on http://www.kernel.org/???? Thanks in advance. |
Hi,
the source corresponding to your running kernel should be in the package called "linux-source-$(uname -r)". So, you should be able to download it with the following command. Code:
sudo apt-get install linux-source-$(uname -r) You can recompile it using what ever method you like, but I would recommend using the make-kpkg command from the "kernel-package" package. HTH, EVo2. |
In case you are interested in Ubuntu kernels from the Ubuntu developers that you can download as already compiled .deb packages, you can get them from here:
http://kernel.ubuntu.com/~kernel-ppa/mainline/ That site includes standard Ubuntu kernels as well as kernels that have not yet entered into the standard Ubuntu repositories. |
Quote:
Hi, Thanks for your kindly reply. But when I run sudo apt-get install linux-source-$(uname -r) on my Ubuntu12.04 system, the following error messages will show: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package linux-source-3.2.0-23-generic-pae E: Couldn't find any package by regex 'linux-source-3.2.0-23-generic-pae' So it seems it can not find it. Did you ever seen this before? |
sudo apt-get install linux-source :
Code:
Unpacking linux-source-3.2.0 (from .../linux-source-3.2.0_3.2.0-32.51_all.deb) ... '-32.51' http://packages.ubuntu.com/source/precise/linux The build / update '-23' that you have is a 6 month old version : The relase version → No security updates. Older versions ... linux-source-3.2.0_3.2.0-23.36_all.deb 11-Apr-2012 linux-source-3.2.0_3.2.0-24.38_all.deb 02-May-2012 linux-source-3.2.0_3.2.0-24.39_all.deb 22-May-2012 linux-source-3.2.0_3.2.0-25.40_all.deb 25-May-2012 linux-source-3.2.0_3.2.0-26.41_all.deb 15-Jun-2012 linux-source-3.2.0_3.2.0-27.43_all.deb 07-Jul-2012 linux-source-3.2.0_3.2.0-29.46_all.deb 28-Jul-2012 linux-source-3.2.0_3.2.0-30.48_all.deb 25-Aug-2012 linux-source-3.2.0_3.2.0-31.50_all.deb 07-Sep-2012 http://dk.archive.ubuntu.com/ubuntu/pool/main/l/linux/ . |
Did you do:
Code:
sudo apt-get update |
Hi,
oops, linux-source-$(uname -r) might be too specfic. Please just try linux-source-3.2.0 Evo2. |
Dear all,
Thanks for all your kindly help. Finally I downloaded Linux kernel source for version 3.2.0 with Ubuntu patches at http://packages.ubuntu.com/source/precise/linux |
All times are GMT -5. The time now is 05:30 PM. |