今天在1台ubuntu上想用ping测一下域名,发现竟然没有ping命令,想起来了,我在安装ubuntu 22.04时,选择的是最小化安装模式,估计这些额外的网络工具包并没有安装。
以下是解决ping: command not found 报错的方法。
# ping seafile.liuguohua.com -bash: ping: command not found
常规用apt install ping,尝试安装一下,系统提示,应该是inetutils-ping或iputils-ping包提供工具
# apt install ping Reading package lists... Done Building dependency tree... Done Reading state information... Done Package ping is a virtual package provided by: inetutils-ping 2:2.2-2ubuntu0.1 iputils-ping 3:20211215-1
安装iputils-ping
# apt install iputils-ping Reading package lists... Done Building dependency tree... Done Reading state information... Done The following NEW packages will be installed: iputils-ping 0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. Need to get 42.9 kB of archives. After this operation, 116 kB of additional disk space will be used. Get:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy/main amd64 iputils-ping amd64 3:20211215-1 [42.9 kB] Fetched 42.9 kB in 1s (33.5 kB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package iputils-ping. (Reading database ... 68316 files and directories currently installed.) Preparing to unpack .../iputils-ping_3%3a20211215-1_amd64.deb ... Unpacking iputils-ping (3:20211215-1) ... Setting up iputils-ping (3:20211215-1) ... debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 78.) debconf: falling back to frontend: Readline Scanning processes... Scanning linux images... Running kernel seems to be up-to-date. No services need to be restarted. No containers need to be restarted. No user sessions are running outdated binaries. No VM guests are running outdated hypervisor (qemu) binaries on this host.
ping命令再次测试
# ping seafile.liuguohua.com PING seafile.liuguohua.com (192.168.110.165) 56(84) bytes of data. 64 bytes from root165 (192.168.110.165): icmp_seq=1 ttl=64 time=0.039 ms ^C --- seafile.liuguohua.com ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.039/0.039/0.039/0.000 ms
声明:欢迎大家光临本站,学习IT运维技术,转载本站内容,请注明内容出处”来源刘国华教育“。如若本站内容侵犯了原著者的合法权益,请联系我们进行处理。