Am newbie, and I'm trying on Debian Squeeze to upgrade/compile kernel for problem I'm having with Linux-Vserver. The instructions I'm trying to use start with "apt-get installlinux-source-2.6.32" and "apt-get build-dep linux-source-2.6.32". I'm being advised by the Vserver folks to use 3.2.42.

Q: do I substitute "3.2.42" for the "2.6.32" in my instructions (doesn't work), or would I be using "2.6.32" as a baseline and then download the newer kernel, unpack it etc. a bit later in my steps?

I think part of the goal here is to not use a stock .config, but one that works with my hardware.


  • 1
    "I am a newbie" and "trying to compile kernel to solve problems" don't match. At all. If the distribution you chose doesn't work with the environment it should run in, either change the distribution or the environment so it works together. – Sven Mar 30 '13 at 11:41
  • Appreciate input, but hoping for answer to question – FoolishDog Mar 30 '13 at 11:58

This is not a step professionals take lightly, but it can be done.

Debian has their own brand of kernel compilation documented a few places

The general steps are:

  1. Get the right packages.
  2. Configure it.
  3. Compile it.
  4. Package it.

The Debian packages include the ones you're already aware of but also fakeroot, and make-kpkg. The 3.2 series of source is in the squeeze-backports repo, so enable that repo then do the syntax you already know to get it.

You now have the right packages.

For configuring, you have a couple of options. The safest is to do a make oldconfig in the new source tree, and take the defaults.

The less safe, but sounds like what you're looking for, is make localmodconfig which turns off all modules that aren't currently loaded, which in theory will create a config that exactly matches your hardware. Just make sure that any modules you'll ever use are loaded before running this command, or hand-edit the resulting .config file to turn on the ones you want.

You now have the config.

Compiling and packaging it is easy, debian provides the tools.

fakeroot make-kpkg clean
fakeroot make-kpkg 

This will leave you with a Debian kernel-package that you can install through dpkg.

At this point, you'll have a new kernel! It may even work on the first try. If it doesn't go back to 2 (Configure it) and try again. Repeat until it works.

Some caveats though:

  • We can't tell you which exact kernel modules you'll need. We don't know enough about your system or what it needs to tell you.
  • It is entirely possible you won't end up with a bootable kernel no matter how hard you hack at it. This happens, it's how we learn.
  • It'll now be up to you to stay up to date on Kernel patches. I note that the backported 3.2 kernel is several patch-sets behind latest (you wanted .42, it has .39), so I don't know how often Debian updates those.
  • Thanks so much sysadmin1138 - need to review and digest, and then try! Appreciate the help. – FoolishDog Mar 30 '13 at 12:54

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.