I am following the steps here to rebuild a kernel on a VM: https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel

I have a .config file that I want to use to build it. Where should I put this .config file so that when I type make it uses that? The source I'm building from is linux-lts-utopic-3.16.0, and I'm using the debian folder in that.


The.config file needs to be present in the base directory of a kernel source code which you are going to compile using make utility. Go to base directory and type ls -a the .config file should be there (probably in /usr/src/).

This is a blog for compiling a kernel from source (not ubuntu specific). https://prashantchikhalkar.wordpress.com/2015/05/07/linux-kernel-compilation-from-source-to-running/

| improve this answer | |

If your source file in /usr/src/linux copy .config file into /usr/src/linux and run make oldconfig instead make menuconfig then run make to compile your kernel.

| improve this answer | |
  • Thank you for your answer - I have two "linux" folders in /usr/src/. One of them is linux-headers-3.16.0-30, and the other is linux-headers-3.16.0-30-generic. How do I tell which one is in use? – user3475234 Aug 5 '15 at 14:14
  • It's none of them, they are headers files. You can download any source tarball from kernel.org and extract them anywhere you like in /home directory and follow the above steps. – kenn Aug 5 '15 at 15:16
  • @user3475234 - if you want to check which kernel is in use, just type uname -r it'll give you your running kernel version. If you are trying to learn how to compile a kernel please do it in your /home folder not in /usr/src/ – Prashant Chikhalkar Aug 6 '15 at 5:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.