Kernel modules auto-updater for new kernel versions (Ubuntu)


There is an easy way to auto-update the kernel modules when new kernel versions are installed in Ubuntu, without the need to manually run Just create a stripped version of that script and add an entry in /etc/rc.local to call it at each startup:

Create a file “/opt/”:


if test -e /lib/modules/`uname -r`/extra/redirfs.ko; then
	exit 0

if [ $(id -u) != "0" ]; then
    echo -e "Please run this script with administrator privileges.\n"
    exit 1

echo -e "\n\033[1mBuild the RedirFS kernel modules for real-time protection...\033[0m\n"

if ! test -d /lib/modules/`uname -r`/build; then
    echo -e "\nThen linux kernel source or linux kernel headers for your current kernel version $(uname -r) can not be found."
    echo -e "Please install the kernel source or kernel headers for $(uname -r), then run this script again."
    exit 1

test -d /tmp/driver && rm -rf /tmp/driver
tar xf /opt/COMODO/driver.tar -C /tmp
cd /tmp/driver
ROOT_PATH=/tmp/driver make all
ROOT_PATH=/tmp/driver make install
/sbin/depmod -a

if /sbin/modprobe redirfs && /sbin/modprobe avflt; then
    echo -e "\nRedirFS kernel modules have been successfully installed.\n"
    echo -e "\nRedirFS kernel modules installation failed.\n"

sh /opt/COMODO/ restart
sleep 5
sh /opt/COMODO/ restart

rm -rf /tmp/driver

echo -e "\n\033[1mCOMODO Antivirus is successfully configured, you can start it from Menu or Desktop.\033[0m\n"

Edit /etc/rc.local and add this line:

sh /opt/

That’s all…

Thank you for that tip mmag, great appreciated.

I have never understood why the need to run that command whenever certain OS updates came down. Guess it has something to do with rootkits.

Hello, I’m new to linux and I loved comodo on windows. But now I’m using linuxmint 15. I did what you posted above but I still get:
The Kernel module ‘avtit.ko’ appropriate for your current Kernal version does not exit, please run /opt/COMODO/ to install it. Which I do and except the end license. and then it says it’s installed and updated. Then I run /etc/init.d/cmdavd restart and it does that. But it still comes up with that message. What am I missing?

Thanks for being here for us noobies.


Did anyone find a solution to this?