How do I find a package that provides a given file in OpenSuSE?

17,572

Solution 1

To search from all available packages to find a particular file, you can use the option wp or se --provides --match-exact as an example:

zypper se --provides --match-exact hg

You will see output similiar to the following:

Loading repository data...
Reading installed packages...

S | Name      | Summary                  | Type   
--+-----------+--------------------------+--------
  | mercurial | Scalable Distributed SCM | package

From that point you can install the package through a standard zypper install

zypper in mercurial

It should be noted that zypper wp is obsolete and may no longer be available.

Solution 2

To the googlers of the future: next to @SailorCire 's wonderful solution :-), there is also a tool named scout, which is able to search in practically everything, we can find rpm-s for a binary just as we can find the jars for a given java class.

For example, we can use scout's bin command to find out what package provides the hg executable:

scout bin hg

The result of this search is the mercurial package:

 repository      | package   | path     | binary
-----------------+-----------+----------+--------
 zypp (repo-oss) | mercurial | /usr/bin | hg    

Solution 3

I'm using Gecko Linux XFCE. I opened Yast2 and installed gnome-search-tool and gnome-shell-search-provider-nautilus. It works fine, just like Catfish.

Share:
17,572

Related videos on Youtube

peterh
Author by

peterh

Truthful words are not beautiful; beautiful words are not truthful. (Lao Tze) The Last Question

Updated on September 18, 2022

Comments

  • peterh
    peterh over 1 year

    I am thinking on some like Contents-<arch>.gz on Debian. A network service were also okay. Does it exist?

    Simple elaboration: For example, we need a binary named exampletool, which we know very good from other distributions or operation systems. We want to install that, for example, with zypper. But zypper can only install a package. To find out, in which package can we find the required exampletool binary, we need to do practically a search, and ideally a fast, indexed search in the file list of the currently not installed, but in the repositories available packages. On debian, there is an index file in the package repositories named Contents-amd64.gz, in which we can find the required package with a single zgrep command. I am looking for some similar, single-command solution for OpenSUSE, too. If there is none, a web service were also okay for the same functionality.

  • SebMa
    SebMa over 4 years
    Can you please be a little more specific about the scout tool ? Can you give its' complete name or URL to its' code ?
  • peterh
    peterh over 4 years
    @SebMa It was downloadable from rpm, probably by zypper. It is possible, that it was in a non-standard repo. I can't remember very well :-( I don't use SuSE any more. But it is quite possible that I will be, then I will check it and explain what I found. It is possible, that SuSE has changed a lot since then.
  • SebMa
    SebMa over 4 years
    On my Jolla1 device (SailFishOS), zypper wp scout says No matching items found.
  • peterh
    peterh over 4 years
    @SebMa Googling for "scout tool rpm" I found this link on the spot, in the current moment I can't help more. Probably you will need to install it from some non-standard repository.
  • SebMa
    SebMa over 4 years
    On the link you've provided, it says : "Scout is an interface to Tomboy notes or Gnote that uses DBus to communicate." I'm not sure that's the tool we are looking for.
  • SebMa
    SebMa over 4 years
    On the other hand, thanks to the second result of "scout tool rpm", I found this scout. Is this the one ?
  • Lester
    Lester over 4 years
    This is not always reliable. I don't know why but file names such as zypper search --provides [--match-exact] getenforce do not return results, while zypper search --provides nslookup does.
  • peterh
    peterh about 3 years
    I think the provides is a very different thing (not sure in OpenSUSE any more). The last what would be reliable if it depends on what the package maintainers manually say. The question asks for what actually lists the files in all packages in the remote repository, and searches in them. How about the other answers? zypper was quite a reliable solution for me (at the time - I do not use opensuse any more).
  • ZeroKnight
    ZeroKnight about 3 years
    I believe that provides are symbolic and set manually by the packager, but I don't know much about how openSUSE creates packages. As such, they don't necessarily reflect package file contents.