为什么找不到我想要的 iptables 版本?

为什么找不到我想要的 iptables 版本?

我正在尝试在 ubuntu 22.04 中安装 iptables 1.6.2 版本。 (请注意:这是关于 iptables 1.6.2 的。我安装 iptables 1.8.7 没有问题,但我需要 1.6.2。)

root@924516f76c4c:/var/www# apt install iptables=1.6.2
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package iptables is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libxtables12

E: Version '1.6.2' for 'iptables' was not found

我不明白对 libxtables12 的引用。我安装 iptables 1.6.2 的动机是为了在我尝试使用 ufw 时解决这个问题...

root@924516f76c4c:/var/www# ufw status
ERROR: problem running iptables: iptables v1.8.7 (nf_tables): Could not fetch rule set generation id: Permission denied (you must be root)

我读到这个错误可能意味着我需要使用 iptables 1.6.2。

我尝试在安装之前运行 apt update,但这没有帮助。

答案1

您无法在 Ubuntu 22.04 中安装iptables1.6.2,apt因为它在存储库中不可用。无论如何,安装旧版本iptables不太可能解决您的问题。

顺便说一句,您需要指定一个包裹版本,其中包括“1.6.2”以上;对于 1.8.7 你需要说

sudo apt install iptables=1.8.7-1ubuntu5

当前版本为 22.04,如果 1.6.2 可用,您还必须指定软件包版本。

相关内容