linux 没有ifconfig命令 :-bash: ifconfig

在新安装的Linux系统中,发现无法使用ifconfig命令,通过运行"yum install net-tools.x86_64"命令成功安装了net-tools软件包,从而解决了ifconfig命令找不到的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

刚安装了linxu,但是可以ping www.baidu.com,但是不能使用/ifconfig命令,也不能使用/sbin/ifconfig命令,最后,通过安装”yum install net-tools.x86_64” 解决了。

*********************************************************************************************************

[root@localhost ~]# ifconfig
-bash: ifconfig: 未找到命令
[root@localhost ~]# /sbin/ifconfig
-bash: /sbin/ifconfig: 没有那个文件或目录
[root@localhost ~]# yum install net-tools.x86_64
已加载插件:fastestmirror
Determining fastest mirrors
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base                                                                                | 3.6 kB  00:00:00     
extras                                                                              | 3.4 kB  00:00:00     
updates                                                                             | 3.4 kB  00:00:00     
(1/4): base/7/x86_64/group_gz                                                       | 166 kB  00:00:00     
(2/4): extras/7/x86_64/primary_db                                                   | 188 kB  00:00:00     
(3/4): updates/7/x86_64/primary_db                                                  | 3.4 MB  00:00:00     
(4/4): base/7/x86_64/primary_db                                                     | 6.0 MB  00:00:09     
正在解决依赖关系
--> 正在检查事务
---> 软件包 net-tools.x86_64.0.2.0-0.24.20131004git.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

===========================================================================================================
 Package                架构                版本                                   源                 大小
===========================================================================================================
正在安装:
 net-tools              x86_64              2.0-0.24.20131004git.el7               base              306 k

事务概要
===========================================================================================================
安装  1 软件包

总下载量:306 k
安装大小:918 k
Is this ok [y/d/N]: y
Downloading packages:
警告:/var/cache/yum/x86_64/7/base/packages/net-tools-2.0-0.24.20131004git.el7.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY
net-tools-2.0-0.24.20131004git.el7.x86_64.rpm 的公钥尚未安装
net-tools-2.0-0.24.20131004git.el7.x86_64.rpm                                       | 306 kB  00:00:00     
从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 检索密钥
导入 GPG key 0xF4A80EB5:
 用户ID     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
 指纹       : 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 软件包     : centos-release-7-5.1804.el7.centos.x86_64 (@anaconda)
 来自       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
是否继续?[y/N]:y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : net-tools-2.0-0.24.20131004git.el7.x86_64                                              1/1 
  验证中      : net-tools-2.0-0.24.20131004git.el7.x86_64                                              1/1 

已安装:
  net-tools.x86_64 0:2.0-0.24.20131004git.el7                                                              

完毕!
[root@localhost ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.246.124  netmask 255.255.255.0  broadcast 192.168.277.251
        inet6 fe80::77e5:1ffd:1a6e:7279  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:5b:f2:c7  txqueuelen 1000  (Ethernet)
        RX packets 10792  bytes 11237387 (10.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4240  bytes 347514 (339.3 KiB)
        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 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@localhost ~]# 
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值