How to search for packages that provides a virtual package?

Posted by netvope on Ask Ubuntu See other posts from Ask Ubuntu or by netvope
Published on 2013-10-26T11:30:42Z Indexed on 2013/10/26 16:08 UTC
Read the original article Hit count: 280

Filed under:

How to search for packages that provides a virtual package?

For example, I want to search for packages that provides "x-terminal-emulator" in the "main" repository of Ubuntu 12.04. One way to do this is to parse the package index:

curl http://archive.ubuntu.com/ubuntu/dists/precise/main/binary-amd64/Packages.gz | zcat | grep -B12 '^Provides: x-terminal-emulator' | grep ^Package:

which gives me the following results:

Package: gnome-terminal
Package: konsole
Package: xterm

Is that a better way to do this? Can it be done with any of the official tools (apt-get/apt-cache/etc)?

© Ask Ubuntu or respective owner

Related posts about package-management