sorin Asked: 2010-07-03 01:21:35 +0800 CST2010-07-03 01:21:35 +0800 CST 2010-07-03 01:21:35 +0800 CST How do I make a wildcard package search using apt-get? 772 With yum it was simple: yum list *xxx* but this does not work with apt-get. How can I do a search like this? Also, how do I see what package provides a specific command? ubuntu debian apt 5 Answers Voted Best Answer Weboide 2010-07-03T03:09:31+08:002010-07-03T03:09:31+08:00 If you wish to search a specific string only in package names, you can do: apt-cache search --names-only 'xxx' This will return anything that contains 'xxx' in their package name. You can also use regular expressions: apt-cache search --names-only 'php5$' This will return any package with their name ending in php5. Regular expressions can also be used without the --names-only. See apt-cache(8) man page. lg. 2010-07-03T01:48:59+08:002010-07-03T01:48:59+08:00 An alternative is "apt-cache search" Jasper 2010-07-03T01:36:26+08:002010-07-03T01:36:26+08:00 First Question: use dselect or aptitude to see/search all available packagesm, their both curses frontends to apt-get and/or dpkg Second Question: dpkg -S <COMMAND> It would be wise to include the whole path in your dpkg search (e.g. /bin/ls, not just ls). John Eikenberry 2010-07-09T15:13:27+08:002010-07-09T15:13:27+08:00 Yet another alternative is axi-cache (in the apt-xapian-index package). It uses the xapian search engine to search through the apt archives. David Okwii 2017-06-20T08:46:04+08:002017-06-20T08:46:04+08:00 Put the search query in a quotes and then use regex. For install to search whatever version of php-curl, I use; sudo apt-cache search "php.*curl" which returns; php5-curl - CURL module for php5 php-http-request2 - Provides an easy way to perform HTTP requests
If you wish to search a specific string only in package names, you can do:
This will return anything that contains 'xxx' in their package name.
You can also use regular expressions:
This will return any package with their name ending in php5.
Regular expressions can also be used without the --names-only. See apt-cache(8) man page.
An alternative is "apt-cache search"
First Question: use dselect or aptitude to see/search all available packagesm, their both curses frontends to apt-get and/or dpkg
Second Question:
dpkg -S <COMMAND>
It would be wise to include the whole path in your dpkg search (e.g. /bin/ls, not just ls).
Yet another alternative is axi-cache (in the apt-xapian-index package). It uses the xapian search engine to search through the apt archives.
Put the search query in a quotes and then use regex. For install to search whatever version of php-curl, I use;
which returns;