Adding something like this should resolve this probelm: # # If depmod and modules.dep files exist, remove modules.dep and recreate it # since the contents of modules.dep do not have a consistent format across # releases. # DEPMOD=$(type -P depmod) if [ -f $DEPMOD ] && [ -f /lib/modules/$KERNEL_VERSION/modules.dep ]; then rm /lib/modules/$KERNEL_VERSION/modules.dep; $DEPMOD $KERNEL_VERSION; fi