UFW Installation - Ubuntu 12.04.x x64 vmlinuz-3.8.0-37-generic?

Posted April 27, 2014 4k views
Originally, I was currently trying to install UFW for security reasons on my WebServer (Which was originally running Ubuntu 12.04.x x64 vmlinuz-3.8.0-37-generic), following this guide here: Basically, I did a "sudo apt-get install ufw", and when I type "ufw status" the message I had received is as follows: "ERROR: problem running iptables: FATAL: Could not load /lib/modules/3.8.0-37-generic/modules.dep: No such file or directory ... ip tables v1.4.12: can't initialize iptables table 'filter': Table does not exist ... Perhaps iptables or your kernel needs to be upgraded." Currently, I've reverted to Ubuntu 12.04.x x64 vmlinuz-3.2.0-60-virtual, and it now functions as it should (As I did a "ls /lib/modules/" and found the modules currently installed). Is there a way I can install modules/etc for Ubuntu 12.04.x x64 vmlinuz-3.8.0-37-generic, so UFW works on that kernel? (I'm new to this, so I'm not too familiar with the differences between some kernels). Thanks.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
6 answers
You're getting that error because you haven't installed the respective kernel package on your droplet which is why it can't find the iptables module.
I recommend setting your droplet to use the latest kernel available, installing its package, and then rebooting your droplet.
Currently it's 3.8.0-38-generic, so set your droplet to use "* Ubuntu 12.04.x x64 vmlinuz-3.8.0-38-generic", install the package:
sudo apt-get install linux-image-vmlinuz-3.8.0-38-generic
and finally, power off your droplet and boot it up from the control panel:
sudo poweroff
Thank you very much for the reply!
Though, to install the modules for the image I was currently using, I used:

sudo apt-get install linux-image-$(uname -r)

......But there is a still a problem remaining.

The module install worked great, though when I type "ufw status" after installing ufw, this message shows up (It's slightly different from my post above):

ERROR: problem running iptables: FATAL: Error inserting ip_tables (/lib/modules/3.8.0-38-generic/kernel/net/ipv4/netfilter/ip_tables.ko): Invalid module format
iptables v1.4.12: can't initialize iptables table 'filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs up be upgraded."

My current kernel is 3.8.0-38-generic, and there does exist a folder now for it in /lib/modules.

PS: Is there a large difference between "generic" and "virtual"?
So after some research and relating to my above question, I discovered that when I run the command "lsmod", the only thing I currently see listed is "floppy". There are no other modules loaded, which is probably the problem.

What would be the safest way to load all (or just the necessary) modules?

Yes. I've rebooted my droplet. The only module showing up is "floppy" after a reboot.
Any luck with this problem? I'm having the same, after an attempt to resize my droplet..