在 Debian 最小化安装(minimal / netinst) 中默认 没有 ifconfig,原因主要有两个:
ifconfig 属于 net-tools,而它已被“弃用”ifconfig 来自 net-tools 软件包iproute2 提供的命令是:ip addr
ip link
ip route
Debian 最小化系统为了精简体积,默认只安装 iproute2,不再安装 net-tools。
最小化安装的目标是:
因此:
ip 就不装 ifconfigwhich ifconfig
# 通常无输出
dpkg -l | grep net-tools
# 通常无结果
sudo apt update
sudo apt install net-tools
安装后:
ifconfig
ip addr show
ip route
ip link set eth0 up
Debian 最小化系统没有
ifconfig,是因为它属于已被弃用的net-tools,而系统默认只使用更现代、更轻量的iproute2。
如果你愿意,我也可以给你一份 ifconfig → ip 命令对照表。