【Linux operation 37】Centos 7.9 最小化安装时找不到ifconfig命令

ifconfig命令是设置或显示网络接口的程序,可以显示出机器的网卡信息,可是在最小化安装的时候会默认不安装ifconfig等命令,此时就需要需要安装一个net-tools的工具包解决此问题。

1、发现现象

[root@localhost yum.repos.d]# ifconfig
-bash: ifconfig: command not found

2、查找安装包

[root@localhost /]# yum list | grep net-tool*
net-tools.x86_64                          2.0-0.25.20131004git.el7     @base 

3、安装

[root@localhost yum.repos.d]# yum install net-tools
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package net-tools.x86_64 0:2.0-0.25.20131004git.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================================================================================================== Package                                             Arch                                             Version                                                            Repository                                      Size
==============================================================================================================================================================================================================================Installing:
 net-tools                                           x86_64                                           2.0-0.25.20131004git.el7                                           base                                           306 k

Transaction Summary
==============================================================================================================================================================================================================================Install  1 Package

Total download size: 306 k
Installed size: 917 k
Is this ok [y/d/N]: y
Downloading packages:
net-tools-2.0-0.25.20131004git.el7.x86_64.rpm                                                                                                                                                          | 306 kB  00:00:02     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : net-tools-2.0-0.25.20131004git.el7.x86_64                                                                                                                                                                  1/1 
  Verifying  : net-tools-2.0-0.25.20131004git.el7.x86_64                                                                                                                                                                  1/1 

Installed:
  net-tools.x86_64 0:2.0-0.25.20131004git.el7                                                                                                                                                                                 

Complete!

4、确认

[root@localhost yum.repos.d]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.211.129  netmask 255.255.255.0  broadcast 192.168.211.255
        ether 00:0c:29:8c:a6:a4  txqueuelen 1000  (Ethernet)
        RX packets 248246  bytes 344824443 (328.8 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 54154  bytes 4958022 (4.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 16  bytes 1392 (1.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 16  bytes 1392 (1.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值