軟件環境
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 addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 08:00:27:b4:d4:69 brd ff:ff:ff:ff:ff:ff inet 192.168.3.197/24 brd 192.168.3.255 scope global enp0s3 valid_lft forever preferred_lft forever inet6 fe80::a21a:8e53:54c2:4243/64 scope link valid_lft forever preferred_lft forever
如果要安裝
[root@localhost ~]# yum provides ifconfig Loaded 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 ifconfig Loaded 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
可以看到沒有yum的使用權限,這個可以參照另一篇文章的解決辦法:http://www.cnblogs.com/nbartchen/p/8565816.html
在解決了RedHat7的yum源問題之后,使用下面的命令進行安裝,安裝完成后就可以使用ifconfig命令了
[root@localhost ~]# yum install net-tools