コマンドを収録しているパッケージを探す(apt編)

スポンサーリンク

コマンドは知っているけど、どのパッケージに入っているのかが分からないときに探す方法です。

検証した環境

$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
$ uname -r
5.15.56-v8+

必要なパッケージの導入

$ sudo apt install apt-file
$ sudo apt-file update

収録パッケージの探し方

「dig」コマンドが収録するパッケージを探してみます。

検索は指定したパターン一致によるものです。検索する際に、検索するコマンドの最後に「$(ドルマーク)」を付け加えると良いかと思います。

$ apt-file -x search /dig$
apt-file -x search /dig$
bind9-dnsutils: /usr/bin/dig ・・・ 「bind9-dnsutils」というパッケージに収録されている
epic4: /usr/share/epic4/script/dig
epic4-help: /usr/share/epic4/help/8_Scripts/dig

指定したパターンを一覧で表示することも可能です。

$ apt-file list bind9-dnsutils
apt-file list bind9-dnsutils
bind9-dnsutils: /usr/bin/delv
bind9-dnsutils: /usr/bin/dig
bind9-dnsutils: /usr/bin/dnstap-read
bind9-dnsutils: /usr/bin/mdig
bind9-dnsutils: /usr/bin/nslookup
bind9-dnsutils: /usr/bin/nsupdate
bind9-dnsutils: /usr/share/doc/bind9-dnsutils/changelog.Debian.gz
bind9-dnsutils: /usr/share/doc/bind9-dnsutils/changelog.gz
bind9-dnsutils: /usr/share/doc/bind9-dnsutils/copyright
bind9-dnsutils: /usr/share/man/man1/delv.1.gz
bind9-dnsutils: /usr/share/man/man1/dig.1.gz
bind9-dnsutils: /usr/share/man/man1/dnstap-read.1.gz
bind9-dnsutils: /usr/share/man/man1/mdig.1.gz
bind9-dnsutils: /usr/share/man/man1/nslookup.1.gz
bind9-dnsutils: /usr/share/man/man1/nsupdate.1.gz