Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Find package that provides file

  1. #1

    Default 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

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    27,108
    Blog Entries
    15

    Default Re: Find package that provides file

    Hi
    Subtle difference between a package and a file in a package;
    Code:
    zypper se --provides libstdc++.so.6
    Provides a list of potential packages, whereas the following provides the actual packages containing the file;
    Code:
    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...)
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3

    Default Re: Find package that provides file

    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.

  4. #4
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,777
    Blog Entries
    3

    Default Re: Find package that provides file

    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.
    openSUSE Leap 15.1; KDE Plasma 5;
    testing Leap 15.2Alpha

  5. #5
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    27,108
    Blog Entries
    15

    Default Re: Find package that provides file

    Quote Originally Posted by orodbhen View Post
    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.
    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...
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  6. #6

    Default Re: Find package that provides file

    Quote Originally Posted by malcolmlewis View Post
    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.

  7. #7

    Default Re: Find package that provides file

    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.
    Code:
    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.
    Last edited by wolfi323; 28-Feb-2016 at 07:17.

  8. #8

    Default Re: Find package that provides file

    Quote Originally Posted by wolfi323 View Post
    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.
    Code:
    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

  9. #9

    Default Re: Find package that provides file

    Quote Originally Posted by dwellen View Post
    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.

  10. #10
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    15,761

    Default Re: Find package that provides file

    Yast has a provides search

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •