SSブログ

わからないファイルのパッケージを探すyum providesとapt-file search

stropts.hのファイルがどのパッケージにあるのか調べたいとき、下記のようにyum providesのコマンドから調べることができるようだ。

$ yum provides */stropts.h
Loaded plugins: fastestmirror
base 2705/2705
extras/filelists_db | 199 kB 00:00
updates/filelists_db | 1.7 MB 00:01
glibc-headers-2.5-65.i386 : 標準 C ライブラリを使用した開発用ヘッダーファイル。
Repo : base
Matched from:
Filename : /usr/include/stropts.h
Filename : /usr/include/bits/stropts.h
Filename : /usr/include/sys/stropts.h

この場合、yum install glibc-headers
とすれば、関係のファイルがインストールされることを示している。

---
yum man で調べると、どのパッケージが提供しているかを見つけるのに使われるとなっている。
yum provides or whatprovides
Is used to find out which package provides some feature or file.
Just use a specific name or a file-glob-syntax wildcards to list
the packages available or installed that provide that feature or
file.

aptのパッケージには、
apt-file search というコマンドがあり、同じようにパッケージのわからないファイルを探すのに役立つ。
$ apt-file search stropts.h
libace-dev: /usr/include/ace/OS_NS_stropts.h
libace-dev: /usr/include/ace/os_include/os_stropts.h
libc6-dev: /usr/include/i386-linux-gnu/bits/stropts.h
libc6-dev: /usr/include/i386-linux-gnu/sys/stropts.h
libc6-dev: /usr/include/stropts.h
libc6-dev-amd64: /usr/include/bits/stropts.h
libc6-dev-amd64: /usr/include/sys/stropts.h
libc6-dev-armel-cross: /usr/arm-linux-gnueabi/include/bits/stropts.h
libc6-dev-armel-cross: /usr/arm-linux-gnueabi/include/stropts.h
libc6-dev-armel-cross: /usr/arm-linux-gnueabi/include/sys/stropts.h
libc6-dev-armhf-cross: /usr/arm-linux-gnueabihf/include/bits/stropts.h
libc6-dev-armhf-cross: /usr/arm-linux-gnueabihf/include/stropts.h
libc6-dev-armhf-cross: /usr/arm-linux-gnueabihf/include/sys/stropts.h
lsb-build-base3: /usr/include/lsb3/stropts.h
manpages-posix-dev: /usr/share/man/man7/stropts.h.7posix.gz
tendra: /usr/lib/TenDRA/lib/include/svid3.api/stropts.h
tendra: /usr/lib/TenDRA/lib/include/unix95.api/stropts.h

この場合、コンパイルするときに必要なファイルならば、
apt-get install libc6-dev
とすればよいようである。

この広告は前回の更新から一定期間経過したブログに表示されています。更新すると自動で解除されます。