4 Replies Latest reply: May 3, 2014 8:28 PM by Alanc-Oracle RSS

    How find out which package provides specific library

    user10476892

      I am trying to find analog of “rpm –qf” command(find a package , that provides specific system library) for Solaris 11.

      I have found plenty of references on those issue. It should be command like :

      pkg search <library_path>

      or

      pkg contents -o pkg.name,path -a path=’<library_path>’

       

      But!!! Problem is – it works for some files and do not work for others… For example :

      pkg search -l /lib/libdl.so

      brings output:

      INDEX      ACTION VALUE        PACKAGE

      path link   lib/libdl.so pkg:/system/linker@0.5.11-0.175.1.0.0.24.2

       

      But :

      pkg search /usr/lib/64/libfru.so.1

      brings empty output… Actually on all libs from /usr/lib/64 I get empty output…

      Do someone have any idea? Finally - all those libs at /usr/lib/64 where installed by some package...

      They did not some "from fresh air"...

        • 1. Re: How find out which package provides specific library
          Rmanus-Oracle

          That's because there is no package that delivers /usr/lib/64/libfru.so.1


          /usr/lib/64 is a link to /usr/lib/amd64 (on x86) so the correct search path should be /usr/lib/amd64/libfru.so.1

           

          $ pkg search /usr/lib/amd64/libfru.so.1

          INDEX      ACTION VALUE                     PACKAGE

          path       file   usr/lib/amd64/libfru.so.1 pkg:/system/fru-id@0.5.11-0.175.1.0.0.24.2

           

          or simply

           

          $ pkg search libfru.so.1

          • 2. Re: How find out which package provides specific library
            Pascal Kreyer-Oracle

            First, you can look if the library is provided directly by a package :

             

            # pkg search -o action.key,basename,pkg.name,fmri '*:path:*libfru.so.1'

            ACTION.KEY                  BASENAME PKG.NAME      FMRI

            usr/lib/amd64/libfru.so.1            system/fru-id

            usr/lib/libfru.so.1                  system/fru-id

            usr/lib/sparcv9/libfru.so.1          system/fru-id

             

            Then if this is not the case, you can look if one of the directories in the path is not a link :

             

            # pkg search -o action.key,basename,pkg.name 'link:path:*usr/lib/64'

            # pkg search -o action.key,basename,pkg.name 'hardlink:path:*usr/lib/64'

            • 3. Re: How find out which package provides specific library
              alan.pae

              In addition to what's posted above pkg by itself checks the local installation.

               

              If you want to search a remote repository then you need to add -r:

               

              pkg search libfru.so.1

               

              INDEX      ACTION VALUE                       PACKAGE

               

              basename   file   usr/lib/libfru.so.1         pkg:/system/fru-id@0.5.11-0.175.1.0.0.24.2

              basename   file   usr/lib/amd64/libfru.so.1   pkg:/system/fru-id@0.5.11-0.175.1.0.0.24.2

              basename   file   usr/lib/sparcv9/libfru.so.1 pkg:/system/fru-id@0.5.11-0.175.1.0.0.24.2

              basename   file   usr/lib/libfru.so.1         pkg:/system/fru-id@0.5.11-0.175.1.0.0.24.2

              basename   file   usr/lib/sparcv9/libfru.so.1 pkg:/system/fru-id@0.5.11-0.175.1.0.0.24.2

              basename   file   usr/lib/libfru.so.1         pkg:/system/fru-id@0.5.11-0.175.1.0.0.24.2

              basename   file   usr/lib/amd64/libfru.so.1   pkg:/system/fru-id@0.5.11-0.175.1.0.0.24.2

               

              $ pkg search -r libfru.so.1

               

              INDEX      ACTION VALUE                       PACKAGE

               

              basename   file   usr/lib/libfru.so.1         pkg:/system/fru-id@0.5.11-0.175.1.0.0.24.2

              basename   file   usr/lib/amd64/libfru.so.1   pkg:/system/fru-id@0.5.11-0.175.1.0.0.24.2

              basename   file   usr/lib/sparcv9/libfru.so.1 pkg:/system/fru-id@0.5.11-0.175.1.0.0.24.2

              basename   file   usr/lib/libfru.so.1         pkg:/system/fru-id@0.5.11-0.175.1.0.0.24.2

              basename   file   usr/lib/sparcv9/libfru.so.1 pkg:/system/fru-id@0.5.11-0.175.1.0.0.24.2

              basename   file   usr/lib/libfru.so.1         pkg:/system/fru-id@0.5.11-0.175.1.0.0.24.2

              basename   file   usr/lib/amd64/libfru.so.1   pkg:/system/fru-id@0.5.11-0.175.1.0.0.24.2

               

              alan

              • 4. Re: How find out which package provides specific library
                Alanc-Oracle

                pkg search switched to using -r by default in OpenSolaris 2009.06, and it is default in all Solaris 11 releases, so you don't need to specify it any more.   You need to specify -l now to restrict searches to just the locally installed packages.