4

In the past I used to search for a package specifying a part of its name in Synaptic, as far as I can remember. Now it searches in package descriptions too and this is very inconvenient as it gives a huge lot of irrelevant results. I have tried using console aptitude and apt-cache search but both of them do the same. So how do I search in the names only (ignoring the descriptions)?

1 Answer 1

6

With apt-cache, you can use the --names-only switch with your search term, and/or use some regex to narrow the searches down. Some examples I have used are listed below.

1) Using --names-only with a simple search of the word launcher cuts out a lot of results:

apt-cache search launcher --names-only

Often when using regex in your searches, --names-only isn't necessary as well, since you narrow the results down much further anyway, as these examples below demonstrate.

2) You could use regex to find all available desktop environments available:

apt-cache search -- '-desktop$'

3) or to find dev files that you don't know the name of:

apt-cache search 'jpeg*-dev'

The methods shown in the examples above are very useful when using apt-cache to search for packages for which you only partially know the name.

1
  • Both apt-cache search launcher --names-only and apt-cache search --names-only launcher work! I thought the first one wouldn't.
    – user25656
    May 7, 2013 at 12:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .