zoukankan      html  css  js  c++  java
  • RedHat7.4最小化安装没有ifconfig命令

    软件环境

      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
  • 相关阅读:
    144. Binary Tree Preorder Traversal
    excel 文本拼接
    excel中文转拼音(方便复制版本)
    odoo 日志文件太大处理,logfile自动轮替
    编码对象或者字串中包含Unicode字符怎样转换为中文
    odoo 返回成功提示信息
    odoo 对res_partner,res_users添加字段重启服务失败处理
    odoo 根据当前记录的值动态筛选many2many,many2one,one2many数据
    odoo 中%()d的使用
    nginx 监听非标准端口80,重定向端口丢失问题解决
  • 原文地址:https://www.cnblogs.com/nbartchen/p/8574484.html
Copyright © 2011-2022 走看看