CentOS8 安装ping 命令

su -root

 

Docker的CentOS镜像由于做了精简,去掉了 ping 命令,那我们该如何安装这个命令呢

首先可以用 yum provides 命令来搜索哪个软件包里包含了 ping 命令


    [root@a7128460b671 /]# yum provides "*/ping"
    Loaded plugins: fastestmirror, ovl
    Determining fastest mirrors
     * base: mirrors.cn99.com
     * extras: mirrors.cn99.com
     * updates: mirrors.cn99.com
    base                                                                                                                                                                  | 3.7 kB     00:00     
    base/primary_db                                                                                                                                                       | 4.7 MB     00:01     
    extras                                                                                                                                                                | 3.4 kB     00:00     
    extras/primary_db                                                                                                                                                     |  29 kB     00:00     
    updates                                                                                                                                                               | 3.4 kB     00:00     
    updates/primary_db                                                                                                                                                    | 5.3 MB     00:01     
    base/filelists_db                                                                                                                                                     | 6.4 MB     00:01     
    extras/filelists_db                                                                                                                                                   |  25 kB     00:00     
    updates/filelists_db                                                                                                                                                  | 3.2 MB     00:00     
    pacemaker-cli-1.1.15-5.el6.x86_64 : Command line tools for controlling Pacemaker clusters
    Repo        : base
    Matched from:
    Filename    : /usr/lib/ocf/resource.d/pacemaker/ping
     
     
     
    irssi-0.8.15-5.el6.x86_64 : Modular text mode IRC client with Perl scripting
    Repo        : base
    Matched from:
    Filename    : /usr/share/irssi/help/ping
     
     
     
    iputils-20071127-24.el6.x86_64 : Network monitoring tools including ping
    Repo        : base
    Matched from:
    Filename    : /bin/ping
     
     
     
    1:qt-examples-4.6.2-28.el6_5.x86_64 : Programming examples for qt
    Repo        : base
    Matched from:
    Filename    : /usr/lib64/qt4/examples/dbus/pingpong/ping


可以看到好几个软件包都包含这个命令,但 iputils 最像是我们要找的,安装它


    [root@a7128460b671 /]# yum install iputils
    .......
    [root@a7128460b671 /]# ping 114.114.114.114
    PING 114.114.114.114 (114.114.114.114) 56(84) bytes of data.
    64 bytes from 114.114.114.114: icmp_seq=1 ttl=65 time=8.28 ms
    64 bytes from 114.114.114.114: icmp_seq=2 ttl=84 time=9.25 ms
    64 bytes from 114.114.114.114: icmp_seq=3 ttl=63 time=7.69 ms
    64 bytes from 114.114.114.114: icmp_seq=4 ttl=63 time=8.43 ms
    64 bytes from 114.114.114.114: icmp_seq=5 ttl=63 time=10.2 ms
————————————————
版权声明:本文为CSDN博主「豆蔻词工难赋深情」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/zhang197093/article/details/78732494

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

VCHH

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值