【linux】【基础】查某个命令属于哪个包然后yum install 这个包

linux基本命令。

查看dig命令属于哪个包

yum provides dig

Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
docker-ce-stable/x86_64/filelists_db                                                                    |  21 kB  00:00:00
extras/7/x86_64/filelists_db                                                                            | 217 kB  00:00:00
updates/7/x86_64/filelists_db                                                                           | 1.7 MB  00:00:00
32:bind-utils-9.11.4-16.P2.el7.x86_64 : Utilities for querying DNS name servers
源    :base
匹配来源:
文件名    :/usr/bin/dig



32:bind-utils-9.11.4-16.P2.el7_8.2.x86_64 : Utilities for querying DNS name servers
源    :updates
匹配来源:
文件名    :/usr/bin/dig

发现bind-utils包里。先不管哪个版本,安装最新的。

yum install bind-utils

执行这个新安装的命令

[root@centos108 usr]# dig gitlab.ccbjb.com.cn +trace

; <<>> DiG 9.11.4-P2-RedHat-9.11.4-16.P2.el7_8.6 <<>> gitlab.ccbjb.com.cn +trace
;; global options: +cmd
.                       902     IN      NS      h.root-servers.net.
.                       902     IN      NS      b.root-servers.net.
.                       902     IN      NS      g.root-servers.net.
.                       902     IN      NS      i.root-servers.net.
.                       902     IN      NS      c.root-servers.net.
.                       902     IN      NS      d.root-servers.net.
.                       902     IN      NS      j.root-servers.net.
.                       902     IN      NS      a.root-servers.net.
.                       902     IN      NS      e.root-servers.net.
.                       902     IN      NS      k.root-servers.net.
.                       902     IN      NS      m.root-servers.net.
.                       902     IN      NS      f.root-servers.net.
.                       902     IN      NS      l.root-servers.net.
;; Received 239 bytes from 192.168.99.2#53(192.168.99.2) in 27 ms
Written on July 10, 2020