how to find which package contains file?

Joe Marcus Clarke marcus at marcuscom.com
Mon Apr 14 18:23:30 PDT 2003


On Mon, 2003-04-14 at 21:17, Erik Steffl wrote:
> Joe Marcus Clarke wrote:
> 
> >On Mon, 2003-04-14 at 21:03, Erik Steffl wrote:
> >  
> >
> >>   is it possible to find which package contains file?
> >>
> >>   Let's say I know that I need libiconv.so.1 library (just an example), 
> >>which package do I need to install?
> >>    
> >>
> >
> >If you have the package and file already installed on your system:
> >
> >pkg_info -W /path/to/file
> >  
> >
>   thanks but what about the situation described abovwe - when I am 
> trying to find which package to install when there's some file missing? 
> (usually a library but could be something else).

Ah, then (and there are probably better ways, but this came to mind
first):

cd /usr/ports
find . -maxdepth 3 -name pkg-plist | xargs grep <filename>

Note, things like libraries aren't a good choice, since their version is
likely to change.  However, given your libiconv example:

cd /usr/ports
find . -maxdepth 3 -name pkg-plist | xargs grep "libiconv\.so"
./converters/libiconv/pkg-plist:lib/libiconv.so
./converters/libiconv/pkg-plist:lib/libiconv.so.3

Note, simply installing libiconv won't fix your issue as the app in
question wants libiconv.so.1.  In that case, it's best to also update
the app that depends on the old version of the library.  Checkout
sysutils/portupgrade for a suite of tools that will help you manage your
ports and packages.

Joe

> 
>     erik
> 
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
-- 
PGP Key : http://www.marcuscom.com/pgp.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: This is a digitally signed message part
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20030414/b88306ad/attachment.bin


More information about the freebsd-questions mailing list