Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have transferred the disk of a a Hardyvirtual machine to another virtual machine with a different kernel but there is no equivalent of /lib/modules// on disk. How can the /lib/modules of the new kernel be added to the image to let it boot without error messages?

Is there apt-get command to download the kernel modules of the new kernel from the repository?

share|improve this question
up vote 3 down vote accepted

Kernel modules are in the kernel package:

motiejus@skveez> dpkg -S /lib/modules/2.6.32-5-amd64/kernel/arch/x86/kvm/kvm-amd.ko
linux-image-2.6.32-5-amd64: /lib/modules/2.6.32-5-amd64/kernel/arch/x86/kvm/kvm-amd.ko

You will have to apt-get install the kernel that's in the new server to reinstall the mdoules.

You didn't mention the target (new) system distribution. If kernel was compiled from source, you'll have to do sudo make modules_install from the kernel tree. If it's debian/ubuntu and kernel was from the repository, run:

apt-get install linux-image-2.6-<arch>-<flavour> --reinstall

You can get installed kernels in this way:

uname -a
dpkg -l 'linux-image-*'
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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