软件环境
VirtualBox 5.2.8
rhel-server-7.4-x86_64-dvd.iso
系统环境
Win10 64 位 8G内存
最小化安装了RedHat7.4之后,进入系统之后使用命令:
[root@localhost ~]# ifconfig
-bash:ifconfig:command not found
使用如下命令:
[root@localhost ~]# /sbin/ifconfig
-bash: /sbin/ifconfig: No such file or directory
同样没有任何结果,这是因为在最小化安装的里面没有ifconfig的相关包,因为在redhat7之后准备把ifconfig命令废除了,这怎么办呢?一是安装;二是使用替代指令
替代指令ip addr,这个指令的显示和ifconfig的显示差不多
[root@localhost ~]# ip addr1: lo: mtu 65536 qdisc noqueue state UNKNOWN qlen 1link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet127.0.0.1/8scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128scope host
valid_lft forever preferred_lft forever2: enp0s3: mtu 1500 qdisc pfifo_fast state UP qlen 1000link/ether 08:00:27:b4:d4:69brd ff:ff:ff:ff:ff:ff
inet192.168.3.197/24 brd 192.168.3.255scope global enp0s3
valid_lft forever preferred_lft forever
inet6 fe80::a21a:8e53:54c2:4243/64scope link
valid_lft forever preferred_lft forever
如果要安装
[root@localhost ~]# yum provides ifconfigLoaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
No matches found
[root@localhost~]# yum whatprovides ifconfigLoaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
No matches found
在解决了RedHat7的yum源问题之后,使用下面的命令进行安装,安装完成后就可以使用ifconfig命令了
[root@localhost ~]# yum install net-tools