从 Ubuntu 18.04 版本升级到 20.04 (focal) 后,iptables 内核模块丢失:
root@server:~# iptables -L
modprobe: FATAL: Module ip_tables not found in directory /lib/modules/5.4.0-42-generic
iptables v1.8.4 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
Run Code Online (Sandbox Code Playgroud)
我尝试了以下方法,但没有解决问题:
sudo apt-get install --reinstall iptables
Run Code Online (Sandbox Code Playgroud)
sudo apt-get install --reinstall linux-headers-$(uname -r)
Run Code Online (Sandbox Code Playgroud)
sudo dpkg-reconfigure iptables
dkms autoinstall
Run Code Online (Sandbox Code Playgroud)
linux-modules-extra 也已安装
的输出ls -R /var/lib/dkms
是:
/var/lib/dkms:
dkms_dbversion wireguard
/var/lib/dkms/wireguard:
1.0.20200611 kernel-5.4.0-42-generic-x86_64
/var/lib/dkms/wireguard/1.0.20200611:
5.4.0-42-generic source
/var/lib/dkms/wireguard/1.0.20200611/5.4.0-42-generic: …
Run Code Online (Sandbox Code Playgroud)