Saturday, March 21, 2015

Ubuntu Linux: cannot find modules.dep.bin

While trying to load some kernel modules in one of my projects, I encounter the following errors:
root@ubuntu:~# modprobe carl9170
modprobe: ERROR: ../libkmod/libkmod.c:556 kmod_search_moddep() could not open moddep file '/lib/modules/3.10.17/modules.dep.bin'

and the following error:

modprobe: ERROR: ../libkmod/libkmod-index.c:821 index_mm_open() magic check fail: d00dfeed instead of b007f457

To solve this issue, run depmod
# depmod

"depmod creates a list of module dependencies, by reading each module
under /lib/modules/version and determining what symbols it exports, and
what symbols it needs. By default this list is written to modules.dep
in the same directory. If filenames are given on the command line,
only those modules are examined (which is rarely useful, unless all
modules are listed)."

After running depmod, everything should work as expected.

- Tal Kain