Debian/Ubuntu 报错解决:ifconfig: command not found
本来想在Centos里查看ip状态,因此使用
ifconfig
,结果发现出现下面的错误;
ERROR:
[root@localhost ~] # ifconfig
-bash: ifconfig: command not found
解释:出现这个error是因为安装时没有基本工具包导致没有 ifconfig 命令,可以使用命令ip addr
:
※如果还想使用 ifconfig
命令,则需要安装net-tools包:
- 对于Ubuntu则是
sudo apt-get install net-tools
- 对于Centos则是
sudo yum install net-tools
解释:CentOS的软件安装工具不是apt-get 而是yum。