当安装的软件包比所需的新时如何安装 iptables?

当安装的软件包比所需的新时如何安装 iptables?

所需的软件包已安装最新版本:

sudo apt install libiptc0   libxtables12
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libiptc0 is already the newest version (1.8.5-3~bpo10+1).
libxtables12 is already the newest version (1.8.5-3~bpo10+1).
0 upgraded, 0 newly installed, 0 to remove and 44 not upgraded.

尝试安装 iptables :

sudo apt install  iptables
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 iptables : Depends: libiptc0 (= 1.8.2-4) but 1.8.5-3~bpo10+1 is to be installed
            Depends: libxtables12 (= 1.8.2-4) but 1.8.5-3~bpo10+1 is to be installed
E: Unable to correct problems, you have held broken packages.

当安装的软件包比所需的新时如何安装 iptables?

uname -a
Linux debian 5.10.0-0.bpo.5-amd64 #1 SMP Debian 5.10.24-1~bpo10+1 (2021-03-29) x86_64 GNU/Linux

答案1

安装的库来自 Buster backports,而不是 Debian 10。默认情况下,Backports 存储库不是安装候选库,因此要安装匹配的iptables,您需要启用适当的存储库:

sudo apt install -t buster-backports iptables

或者,您可以强制将库降级:

sudo apt install iptables libiptc0/stable libxtables12/stable

相关内容