When the system reports "modprobe not found" despite having proper PATH configuration, we're dealing with more than just a simple path issue. Here's how I systematically diagnosed and resolved this on a Debian-based system (Linux 2.6.32-6-pve).
# Basic checks:
which modprobe
locate modprobe
echo $PATH
# Advanced search:
find / -name "modprobe*" 2>/dev/null
cat /proc/sys/kernel/modprobe
The file /proc/sys/kernel/modprobe
contains the expected path to modprobe (typically /sbin/modprobe
). When this binary is missing, you'll encounter this exact scenario.
# For Debian/Ubuntu:
dpkg -S /sbin/modprobe
# Expected output: kmod: /sbin/modprobe
# For RHEL/CentOS:
rpm -qf /sbin/modprobe
The most reliable solution is to reinstall the package providing modprobe:
# Debian/Ubuntu:
apt-get install --reinstall kmod
# RHEL/CentOS:
yum reinstall kmod
# After installation verify:
ls -la /sbin/modprobe
If package management isn't working, you can manually restore modprobe from another system:
# On working system:
which modprobe
# Copy the binary to affected system using scp or other methods
# Set permissions:
chmod 755 /sbin/modprobe
chown root:root /sbin/modprobe
After restoring modprobe, test with a common module:
modprobe -nv loop
# Should show module loading information without errors
Create a monitoring check to prevent recurrence:
#!/bin/bash
if [ ! -f /sbin/modprobe ]; then
logger -t modprobe_check "Critical: modprobe binary missing"
# Add auto-restore logic here if needed
fi
When encountering the "modprobe not found" error despite having proper PATH configuration, we're dealing with a more fundamental system issue than just environment variables. The key observations from your case:
$ which modprobe
$ locate modprobe
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:
$ find / -name "modprobe*"
/proc/sys/kernel/modprobe
$ cat /proc/sys/kernel/modprobe
/sbin/modprobe
$ /sbin/modprobe
bash: /sbin/modprobe: No such file or directory
First, verify if modprobe is completely missing or just misplaced:
# Check package installation status (Debian/Ubuntu)
dpkg -S modprobe || rpm -qf /sbin/modprobe
# Alternative search method
find / -xdev -type f -name "modprobe" 2>/dev/null
The empty search results suggest several possibilities:
- Kernel module utilities package not installed
- Critical system filesystem corruption
- Custom minimal Linux build without module support
- Broken package installation
For Debian-based systems:
# First identify the package
apt-file search /sbin/modprobe
# Typical package name is kmod
apt-get install --reinstall kmod
For RHEL/CentOS:
yum reinstall kmod
If package management is broken, attempt manual recovery:
# Download static binary (example URL - verify current version)
wget http://ftp.br.debian.org/debian/pool/main/k/kmod/kmod_30+20221128-1_i386.deb
dpkg -x kmod_*.deb ./kmod-extract
cp ./kmod-extract/bin/kmod /sbin/modprobe
ln -s /sbin/modprobe /sbin/insmod
ln -s /sbin/modprobe /sbin/rmmod
After restoration:
# Verify functionality
modprobe -c | head -n 5
# Test module operations
modprobe -n -v fat
lsmod | grep fat
To avoid recurrence:
# Create backup of critical binaries
tar cvzf /root/module-utils-backup.tgz /sbin/modprobe /sbin/insmod /sbin/rmmod /sbin/lsmod
# Set up monitoring
echo '#!/bin/sh
[ -x /sbin/modprobe ] || logger -t modprobe-check "Critical: modprobe missing!"
' > /etc/cron.hourly/modprobe-check
chmod +x /etc/cron.hourly/modprobe-check