How to find out which package provides some feature or file ?
#1
Fri, 2016-06-24 04:56
iamtzh
-
- Offline
- 1 year 9 months ago
- 2016-06-23
For example, if i wanna find out which package provides ab (Apache HTTP server benchmarking tool) in RHEL/CentOS :
[root@test01 ~]# yum whatprovides '*bin/ab' httpd-tools-2.2.15-53.el6.centos.x86_64 : Tools for use with the Apache HTTP Server Repo : base Matched from: Filename : /usr/bin/ab httpd24u-tools-2.4.20-3.ius.el6.x86_64 : Tools for use with the Apache HTTP Server Repo : ius Matched from: Filename : /usr/bin/ab
In Alpine Linux, `apk info --who-owns /sbin/lbu` just like `rpm -qf /sbin/lbu`, only for installed packages, can not search package in the repository. I cann't find any command support this feature like `yum whatprovides`.
Any help would be appreciated!
You can search http://pkgs.alpinelinux.org/packages
There is an API being developed
Until then you can script the site like this
apkfind() {wget -q --no-check-certificate -O - http://pkgs.alpinelinux.org/contents\?file=$1 | sed -e '1,119d' -e '/panel-footer/,$ d' -e 's/]*>//g' -e 's/\&\#x2F\;/\//g' -e '/^ *$/d' | xargs -n 5 | awk '{ printf("%-20s %-7s %-11s %-13s %s\n",$2,$3,$4,$5,$1)}' }
Thanks for your reply!
Any update on the API, or where I can follow progress?