debian bullseye 与 debian bookworm-slim 之间的 netcat 安装过程存在差异

debian bullseye 与 debian bookworm-slim 之间的 netcat 安装过程存在差异

debian:bullseye

oot@4770c7ba00ac:/# apt install -y netcat
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libbsd0 libmd0 netcat-openbsd
The following NEW packages will be installed:
  libbsd0 libmd0 netcat netcat-openbsd

debian:bookworm-slim

apt install -y netcat
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package netcat is a virtual package provided by:
  netcat-openbsd 1.219-1
  netcat-traditional 1.10-47
You should explicitly select one to install.

E: Package 'netcat' has no installation candidate

造成这种差异的原因是什么?我如何预先配置netcat以指向netcat-openbsd

答案1

在 Debian 11 中,netcat是一个过渡包,取决于netcat-openbsd。过渡包已从 Debian 12 中删除,您现在需要明确选择netcat您想要的实现。如果您想继续使用netcat-openbsd,请将您的安装更改为使用:

apt-get install -y netcat-openbsd

netcat-openbsd(和其他netcat实现)设置替代方案,以便nc按照netcat您的预期工作。

相关内容