how to find which package contains file?

Joe Marcus Clarke marcus at
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 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

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"

Note, simply installing libiconv won't fix your issue as the app in
question wants  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.


>     erik
> _______________________________________________
> freebsd-questions at mailing list
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at"
PGP Key :
-------------- 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 :

More information about the freebsd-questions mailing list