Let’s see some methods to find files and their packages in Fink.
find is a command that is provided by most, if not all, Unix-based systems, including Mac OS X. Let’s say you want to find a file named zipfile.py in your Fink installation. On my system,
$ find /sw -name zipfile.py
You can be more specific if you’re sure that a file resides in a certain directory, e.g.
$ find /sw/lib -name libgutils\*dylib
In the command above I also used \* to indicate that I was interested in any file whose name starts with libgutils and ends with dylib.
Furthermore, depending on your configuration, you may use locate or mdfind for this purpose.
Fink uses a fork of Debian’s dpkg tool for binary package management. Here are some useful dpkg commands.
If you want to find out which package installed a given file, use dpkg -S. For example,
$ dpkg -S zipfile.py
Specifying an absolute path will limit the results:
$ dpkg -S /sw/lib/python2.6/zipfile.py
If you want to list the files installed by a given package (e.g. the di package), use dpkg -L:
$ dpkg -L di
The grep command can be useful to filter the results: to list only the binaries (programs) installed under /sw/bin,
$ dpkg -L di | grep ^/sw/bin
If you have a binary package (i.e., a .deb file that was either built on your machine or obtained via a binary distribution), you need to use dpkg -c instead:
$ dpkg -c /sw/fink/debs/bibclean_2.11.4-2_darwin-i386.deb
drwxr-xr-x root/admin 0 2009-09-16 09:04 ./
drwxr-xr-x root/admin 0 2009-09-16 09:04 ./sw/
drwxr-xr-x root/admin 0 2009-09-16 09:04 ./sw/bin/
-rwxr-xr-x root/admin 112564 2009-09-16 09:04 ./sw/bin/bibclean
drwxr-xr-x root/admin 0 2009-09-16 09:04 ./sw/share/
drwxr-xr-x root/admin 0 2009-09-16 09:04 ./sw/share/doc/
drwxr-xr-x root/admin 0 2009-09-16 09:04 ./sw/share/doc/bibclean/
-rw-r--r-- root/admin 26550 2009-09-16 09:04 ./sw/share/doc/bibclean/README
-rw-r--r-- root/admin 2932 2009-09-16 09:04 ./sw/share/doc/bibclean/bibclean.copyright
-rw-r--r-- root/admin 48768 2009-09-16 09:04 ./sw/share/doc/bibclean/bibclean.pdf
-rw-r--r-- root/admin 76512 2009-09-16 09:04 ./sw/share/doc/bibclean/bibclean.ps
-rw-r--r-- root/admin 55226 2009-09-16 09:04 ./sw/share/doc/bibclean/bibclean.txt
drwxr-xr-x root/admin 0 2009-09-16 09:04 ./sw/share/man/
drwxr-xr-x root/admin 0 2009-09-16 09:04 ./sw/share/man/man1/
-rw-r--r-- root/admin 42974 2009-09-16 09:04 ./sw/share/man/man1/bibclean.1
The directory/folder /sw/fink/debs contains convenient symbolic links to the actual .deb files created when packages were built on your machine. On the other hand, .deb files obtained via binary distributions are located under /sw/var/cache/apt/archives.