Read more

Ubtuntu: "FATAL: Could not load /lib/modules/...-generic/modules.dep: No such file or directory"

Kim Klotz
January 27, 2015Software engineer at makandra GmbH

If you get this error (probably because you want to load some modules):

# modprobe xt_comment
FATAL: Could not load /lib/modules/3.2.0-40-generic/modules.dep: No such file or directory
Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

The reason could be that apt-get autoremove already removed /lib/modules/.../modules.dep even if you still using this kernel version:

# uname -r
3.2.0-40-generic
# ls -l /lib/modules/
total 24
drwxr-xr-x 4 root root 4096 Oct 22 17:05 3.2.0-68-generic
drwxr-xr-x 4 root root 4096 Jan  7 16:38 3.2.0-69-generic
drwxr-xr-x 4 root root 4096 Jan  7 16:38 3.2.0-70-generic
drwxr-xr-x 4 root root 4096 Nov 26 15:18 3.2.0-72-generic
drwxr-xr-x 4 root root 4096 Dec 17 15:43 3.2.0-74-generic
drwxr-xr-x 4 root root 4096 Jan 15 21:15 3.2.0-75-generic

To fix this you have to reboot with another kernel version or reinstall the needed kernel package:

apt-get install --reinstall linux-image-3.2.0-40-generic
Posted by Kim Klotz to makandra dev (2015-01-27 19:08)