Suppose I want to search for the packet luasocket in OpenSUSE, but I don't know if it's called lua-socket, lua_socket, liblua-socket, lua5.1-socket, socket-lua or who knows what.

Therefore I make a search:

zypper se lua socket

The problem with this is it shows both packages containing lua keyword and also packets containing socket keyword, thus filling my screen with results I don't want.

zypper search --help tells the following:

   Command options:
     --match-all            Search for a match with all search strings (default).
     --match-any            Search for a match with any of the search strings.

But --match-all does not seem to work the way I expect. How can I AND terms when searching packets in OpenSUSE?

Note: If possible in a cleaner way than:

zypper se lua | grep socket

4 Answers 4


I think that will be your cleanest option (as in easy to type).

You can do a regular expression in zypper:

From the help screen:

* and ? wildcards can also be used within search strings.
If a search string is enclosed in '/', it's interpreted as a regular expression.

You can try:

zypper se 'lua*socket'
  • That only works if you know in which order those words appear. What if I don't if the package I need is mysql-python or python-mysql?
    – Alicia
    Jun 13, 2014 at 22:12

Try to use regex and/or more patterns search like this one:

sudo zypper search /lib.*Qt.*Chart/ /lib.*Qt.*Web/

as described in man page

search (se) [options] [querystring|capability]...
       Search for packages matching any of the given search strings. * and ? wildcard characters can be used within search strings. If the search string is enclosed in /  (e.g. /^k.*e$/) it’s interpreted as a regular expression. See the install command for details about how to specify a capability.

you can use zypper se mysql

And you will get all info with 'mysql', then you can find out what you really want!

  • Are you suggesting to do filter manually, reading the entire screen output myself? That's worse than the grep workaround.
    – Alicia
    Nov 26, 2014 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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