在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
您的预期工作。