Difference between insmod and modprobe

Both insmod and modprobe is using to insert kernel module.
But everyone will prefer modprobe because insmod have no capability to resolve dependency issue . But modprobe can do that.

While we are installing a module using modprobe , first it will check the dependancies in /lib/modules/<kernel-version>/modules.dep. This file contains entries for a module and its corresponding dependencies .  modules.dep file is generated by “depmode” command.

modprobe in action :-

List available Kernel modules
# modprobe -l | more

List Currently loaded modules
# lsmod | more

Install new module
# modprobe <module name >
example :-  modprobe ip_tables

Remove a module
# modprobe -r <module name>

we can use ” rmmod ” , also to delete a module. But admins prefer modprobe with -r option , because modprobe is cleverer than insmod and rmmod.