netfilter-persistent install fails with missing kernel module files

When installing iptables-persistent and its dependency, netfilter-persistent, the apt job kept failing. While netfilter-persistent still uses an init.d script and the server is on systemd, this error appeared in the log:

Sep 05 20:57:42 server systemd[1]: Unit systemd-modules-load.service entered failed state.

Sep 05 20:57:42 server systemd[1]: Dependency failed for netfilter persistent configuration.

Sep 05 20:57:42 server systemd[1]: Failed to start Load Kernel Modules.

Sep 05 20:57:42 server systemd[1]: systemd-modules-load.service: main process exited, code=exited, status=1/FAILURE

Sep 05 20:57:42 server systemd-modules-load[21370]: Failed to lookup alias 'loop': Function not implemented

Sep 05 20:57:42 server systemd-modules-load[21370]: could not open moddep file '/lib/modules/4.1.5-x86_64-linode61/modules.dep.bin'

Sep 05 20:57:42 server systemd[1]: Starting Load Kernel Modules…

At first, I assumed that netfliter-persistent was just a bit dated. But I ran depmod and got this output:

depmod: WARNING: could not open /lib/modules/4.1.5-x86_64-linode61/modules.order: No such file or directory

depmod: WARNING: could not open /lib/modules/4.1.5-x86_64-linode61/modules.builtin: No such file or directory

I then ran into this semi-related thread on the forum (https://forum.linode.com/viewtopic.php?f=20&t=10329) where @rsk mentions "ufw assumes a modular kernel and tries to blindly load the netfilter modules - while they're statically built in on a Linode kernel." Is this the case with netfilter-persistent perhaps? If so, what can I do about it?

5 Replies

I ran into a similar issue earlier today.

This might be related to the issue you are experiencing:

https://bugs.debian.org/cgi-bin/bugrepo … bug=769356">https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=769356

The solution for me was to comment out "loop" in /etc/modules.

I am experiencing the exact same issue in getting netfilter-persistent to run, with the exception that mine is complaining about 'fuse' instead of 'loop'. I also get the same error when running depmod. Any help would be appreciated.

I was able to resolve this issue the following way:

sudo echo "fuse" >> /lib/modules/4.1.5-x86_64-linode61/modules.builtin
sudo touch /lib/modules/4.1.5-x86_64-linode61/modules.order
sudo depmod

You should now be able to install the iptables-persistent package.

I know it's a bit old, but I'm sure other people will make it here since it's near the top of the results I searched for on Google…

I had the error with both fuse and loop, I don't seem to need either so I did this:

Create this file (it can really be named anything as long as it's in that dir)…

/etc/modprobe.d/modules-load-blacklist.conf

and add these two lines:

install loop /bin/false
install fuse /bin/false

In my case the there was no real problem being caused, aside from the failure to start systemd-modules-load, but now it runs fine, now errors/warnings. Hope this helps someone else!

@atgaskins

Thanks man, you saved my weekend!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct