CentOS安装 ping 命令

来源:互联网 发布:淘宝角色管理界面 编辑:程序博客网 时间:2024/06/17 19:44

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

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


[root@a7128460b671 /]# yum provides "*/ping"Loaded plugins: fastestmirror, ovlDetermining fastest mirrors * base: mirrors.cn99.com * extras: mirrors.cn99.com * updates: mirrors.cn99.combase                                                                                                                                                                  | 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 clustersRepo        : baseMatched from:Filename    : /usr/lib/ocf/resource.d/pacemaker/pingirssi-0.8.15-5.el6.x86_64 : Modular text mode IRC client with Perl scriptingRepo        : baseMatched from:Filename    : /usr/share/irssi/help/pingiputils-20071127-24.el6.x86_64 : Network monitoring tools including pingRepo        : baseMatched from:Filename    : /bin/ping1:qt-examples-4.6.2-28.el6_5.x86_64 : Programming examples for qtRepo        : baseMatched from:Filename    : /usr/lib64/qt4/examples/dbus/pingpong/ping

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


[root@a7128460b671 /]# yum install iputils.......[root@a7128460b671 /]# ping 114.114.114.114PING 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 ms64 bytes from 114.114.114.114: icmp_seq=2 ttl=84 time=9.25 ms64 bytes from 114.114.114.114: icmp_seq=3 ttl=63 time=7.69 ms64 bytes from 114.114.114.114: icmp_seq=4 ttl=63 time=8.43 ms64 bytes from 114.114.114.114: icmp_seq=5 ttl=63 time=10.2 ms


搞定^^

原创粉丝点击