How do I make a wildcard package search using apt-get?
Solution 1
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.
Solution 2
An alternative is "apt-cache search"
Solution 3
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).
Related videos on Youtube
sorin
Another geek still trying to decipher the meaning of “42”. It seems that amount his main interest are: online communities of practice and the way they evolve in time product design, simplicity in design and accessibility productivity and the way the IT solutions are impacting it
Updated on September 17, 2022Comments
-
sorin over 1 year
With yum it was simple:
yum list *xxx*
but this does not work withapt-get
.How can I do a search like this?
Also, how do I see what package provides a specific command?
-
sorin almost 14 yearskaerast, you enlightened me! aptitude is the way. Thank. You should put this as an answer instead of a comment. "aptitude search"