Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

4 Answers

up vote 5 down vote accepted

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.

share|improve this answer
1  
aptitude search operates in the same way and you should really be using aptitude rather than apt-get these days. –  kaerast Jul 2 '10 at 11:38
    
kaerast, you enlightened me! aptitude is the way. Thank. You should put this as an answer instead of a comment. "aptitude search" –  sorin Jul 2 '10 at 12:50
add comment

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).

share|improve this answer
add comment

An alternative is "apt-cache search"

share|improve this answer
add comment

Yet another alternative is axi-cache (in the apt-xapian-index package). It uses the xapian search engine to search through the apt archives.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.