I'm looking for a few kernel modules to load i2c-dev and i2c-bcm2708. But the modprobe command returns:

sudo modprobe i2c-dev
modprobe: module i2c-dev not found in modules.dep

How can I list all the available modules in the system? In which directory are they located?

share|improve this question
    
The kernel didnt compile this i2c-dev. You didnt find this module.The kernel modules located /lib/modules/'kernel-version'/drivers. When you are looking for linux drivers. – supriady Jan 18 '17 at 8:26
    
You can check on /boot/config-'kernel-version' and read this config file.You should know which linux modules are loaded or modulars or during compiling kernel didnt enable i2c-dev module. – supriady Jan 18 '17 at 8:33
up vote 36 down vote accepted
  • By default modprobe loads modules from subdirectories located in the /lib/modules/$(uname -r) directory. Usually all files have extension .ko, so you can list them with

    find /lib/modules/$(uname -r) -type f -name '*.ko'
    

    or, taking into account compressed files:

    find /lib/modules/$(uname -r) -type f -name '*.ko*'
    
  • However, to load a module successfully modprobe needs its dependencies listed in the file /lib/modules/$(uname -r)/modules.dep (and a corresponding binary version modules.dep.bin). If some module is present on the system, but is not on the list, then you should run a command depmod which will generate such dependencies and automatically include your module to modules.dep and modules.dep.bin.

  • Additionally, if the module is successfully loaded it will be listed in the file /proc/modules (also accessed via command lsmod).

share|improve this answer
2  
Redhat 7 modules files are compressed in .xz (not sure if it is because of kernel version or OS version.. if someone can clarify it to me?) so I think you might not find them with jimmij's find command. Use instead find /lib/modules/$(uname -r) -type f -name *.ko* – Pozinux Oct 5 '17 at 13:14
1  
@Pozinux Discovered the same thing here on Arch linux at 4.13.10, which have the ending .gz – Johann Nov 3 '17 at 17:12
1  
@posinux: beware : the shell may expand your *.ko* if you happen to have in your current dir some file matching it. better to escape it between single quotes: find /lib/modules/$(uname -r) -type f -name '*.ko*' – Olivier Dulac Nov 21 '17 at 17:01

Type modprobe and press tab, the autocomplete list should contain all the loadable modules

share|improve this answer
    
Actually, his answer is a little better than mine since it's easier to use a tool like grep on the output. – Martin Hansen Sep 16 '15 at 18:18
7  
it doesn't work for some systems – avtomaton Feb 17 '16 at 22:19

There is lsmod command of kmod package in Arch Linux what lists and shows the status of Linux kernel modules that contains other useful commands such as modinfo, rmmod modprobe too.

To list all binaries provided by the package you can type:

pacman -Ql kmod | grep /bin/ --color=always

, and you can also check for the owner package of a binary with pacman -Qo lsmod.


Q switch is to query locally installed packages (unlike S to synchronize, ie. to check remotely).

share|improve this answer

Your Answer

 
discard

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.