Find package that provides file

Is there a zypper equivalent to “yum whatprovides */filename”?

I’ve tried “zypper wp” and “zypper se --provides”, but it seems quite finicky. For example, this works:

zypper se --provides /usr/include/stdio.h

And this:

zypper se --provides libstdc++.so.6

But not this:

zypper wp --provides stdio.h

Also, can zypper install the package directly from the file name, e.g.:

yum install /usr/lib/stdc++.so.6
1 Like

Hi
Subtle difference between a package and a file in a package;


zypper se --provides libstdc++.so.6

Provides a list of potential packages, whereas the following provides the actual packages containing the file;


zypper se --provides /usr/lib64/libstdc++.so.6
zypper se --provides /usr/include/stdio.h

That’s why they suggest the --match-exact option (which still needs the path info…)

Thanks for for the reply.

So is there a way to find the package for a file you don’t know the path for? “yum whatprovides” let’s you use a wildcard, e.g. “*/stdio.h”

Of course, I’m not actually looking for stdio.h. I was just using it to try out zypper on something I I knew would be there. I’m actually trying to find quadmath.h.

I guess you could install “yum” from the repos. I don’t know if that would do what you want, but you might like to try.

Hi
Yes, that’s hard one since it’s buried way down… gcc48-fortran is the package.
/usr/lib64/gcc/your_arch-suse-linux/4.8/include/quadmath.h

I use http://rpm.pbone.net/ for the funky ones…

Thanks. So it sounds like there’s no native OpenSUSE tool that provides deep package inquiries. Perhaps a separate tool? I’m a bit sketchy about installing yum on OpenSUSE.

For packages included in the distribution you could use “pin”, which should be installed by default.
To make it work you need to copy the ARCHIVES.gz from the installation DVD or the online repo to /var/lib/pin/ as instructed when you first run it.

wolfi@amiga:~> pin quadmath.h

 grepping /var/lib/pin/ARCHIVES.gz ... please wait

pin 0.38 - package info for quadmath.h

------------------------------------------------------------------
*** no rpm named quadmath.h installed
------------------------------------------------------------------


------------------------------------------------------------------
*** zgrep quadmath.h /var/lib/pin/ARCHIVES.gz
------------------------------------------------------------------


./suse/i586/gcc49-fortran-4.9.0+r211729-2.1.7.i586.rpm:    -rw-r--r--    1 root    root                     9030 Oct  6 12:59 /usr/lib/gcc/i586-suse-linux/4.9/include/quadmath.h
./suse/i586/gcc48-fortran-4.8.3+r212056-2.2.4.i586.rpm:    -rw-r--r--    1 root    root                     9030 Oct  6 11:20 /usr/lib/gcc/i586-suse-linux/4.8/include/quadmath.h
./suse/x86_64/gcc49-fortran-4.9.0+r211729-2.1.7.x86_64.rpm:    -rw-r--r--    1 root    root                     9030 Oct  6 15:42 /usr/lib64/gcc/x86_64-suse-linux/4.9/include/quadmath.h
./suse/x86_64/gcc48-fortran-4.8.3+r212056-2.2.4.x86_64.rpm:    -rw-r--r--    1 root    root                     9030 Oct  6 12:31 /usr/lib64/gcc/x86_64-suse-linux/4.8/include/quadmath.h

OTOH, you could grep ARCHIVES.gz for the filename manually too.

It’s all rpm based, jus use rpm -qf /path/to/file

But this only works with files that are already on your hard disk.

If you miss a file and want to know which package to install that is useless.

Yast has a provides search

Maybe zypper search -f file ?

1 Like

Did you try to find this in

man zypper

I found

–provides
Search for packages which provide the search strings. A search string here might be also any symbol provided by a package like /bin/vi, libcurl.so.3, perl(Time::ParseDate), web_browser, e.g. search for the package which provides the shell: zypper se --provides /bin/sh