安装的mini版centos无法使用ifconfig、netstat

安装的mini版centos无法使用ifconfig(后续发现netstat也无法使用),简直是太简化了吧,我只是个新手啊。。。
参考的链接:
https://blog.csdn.net/t1anyuan/article/details/80448618
https://blog.csdn.net/smartdt/article/details/78015481
https://blog.csdn.net/jaryle/article/details/51720079

状况如下:

[root@weige lib]# ifconfig
-bash: ifconfig: command not found
[root@weige lib]# netstat
-bash: netstat: command not found

最后发现是该命令对应的Linux安装包没装上,那么问题来了:
如何查看命令对应的包呢?

综合看到了两种写法: #下面均以ifconfig为例
1.yum search ifconfig
2.yum provide /ifconfig (yum whatprovide /ifconfig)

[root@weige lib]# yum search ifconfig
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.sjtu.edu.cn
 * extras: ftp.sjtu.edu.cn
 * updates: ftp.sjtu.edu.cn
=============================================================== Matched: ifconfig ===============================================================
net-tools.x86_64 : Basic networking tools

或者:

[root@weige lib]# yum provides */ifconfig
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.sjtu.edu.cn
 * extras: ftp.sjtu.edu.cn
 * updates: ftp.sjtu.edu.cn
net-tools-2.0-0.22.20131004git.el7.x86_64 : Basic networking tools
Repo        : base
Matched from:
Filename    : /sbin/ifconfig



net-tools-2.0-0.22.20131004git.el7.x86_64 : Basic networking tools
Repo        : @base
Matched from:
Filename    : /sbin/ifconfig

会列出好多信息,挑选出自己想要的,然后安装上 net-tools就可以了。

[root@weige lib]# yum -y install net-tools

安装完成后再使用ifconfig或者netstat就有了!

猜你喜欢

转载自blog.csdn.net/SONGW2018/article/details/81415900