Failed kernel upgrade - depmod syntax error?
Matthew Martinez
I have encountered a problem trying to upgrade my kernel (linux-image-4.4.0-75-generic). I was getting this error:
Running depmod.
Failed to run depmodI checked the permissions on depmod:
root@mycomputer:~# la -la /sbin | grep depmod
-r--r--r-- 1 myuser myuser 1119 gru 20 16:26 depmodIt was read-only and the owner and group was set to my non-root user. After changing the owner to root and giving him +x, I get this error:
Running depmod.
/sbin/depmod: 1: /sbin/depmod: Syntax error: word unexpected (expecting ")")
Failed to run depmodJust trying to run depmod:
root@AP137:~# depmod
-su: /sbin/depmod: cannot execute binary file: Exec format errorI honestly don't know what have I done to break this but the depmod binary is probably corrupted. Is there a way to recover from this?
11 Answer
The depmod command is a part of kmod package so I think reinstalling it will fix your issue.
First run:
sudo dpkg-reconfigure kmodto reconfigure this package without reinstalling it, if it didn't work then:
sudo apt-get install --reinstall kmod