User's Guide - 6. Using the fink Tool from the Command Line
fink tool uses several suffix commands to work on packages from the source distribution.
Some of them need at
least one package name, but can handle several package names at
once. You can specify just the package name (e.g. gimp), or a fully
qualified name with a version number (e.g. gimp-1.2.1) or with both version and revision numbers (e.g. gimp-1.2.1-3). Fink will automatically choose the latest available
version and revision when they are not specified. Others have different options.
What follows is a list of the commands for the
There are some options, which apply to all fink commands. If you
fink --help you get the list of options:
-h, --help - displays help text.
-q, --quiet - causes
fink to be less verbose, opposite of --verbose. Overrides the Verbose flag in
-V, --version - display version information.
-v, --verbose - causes
fink to be more verbose, opposite of --quiet. Overrides the Verbose field in
-y, --yes - assume default answer for all interactive questions.
-b, --use-binary-dist - download pre-compiled packages from the binary
distribution if available (e.g. to reduce compile
time or disk usage).
Note that this mode instructs fink to download the
version it wants if that version is available for
download; it does not cause fink to choose a version
based on its binary availability. Corresponds to the UseBinaryDist flag in
--no-use-binary-dist - Don't use pre-compiled binary packages from the binary
distribution, opposite of the --use-binary-dist flag.
This is the default unless overridden by setting
UseBinaryDist: true in
fink.conf configuration file.
--build-as-nobody - Drop to a non-root user when performing the unpack, patch, compile, and install phases. Note that packages built with this option may be non-functional. You should use this mode for package development and debugging only.
fink-0.25 and later) Perform actions useful to package maintainers: run validation on
.info file before building and on the
.deb after building a
package; turn certain build-time warnings into fatal errors; (
fink-0.26 and later) run the test suites as specified in the field. This sets --tests and --validate to
--tests[=on|off|warn] - (
fink-0.26.0 and later) Causes
InfoTest fields to be activated and test suites specified
TestScript to be executed (see the Fink Packaging Manual). If no argument is given to this
option or if the argument is
on then failures in test suites will
be considered fatal errors during builds. If the argument is
then failures will be treated as warnings.
Causes packages to be validated during a build. If no argument is
given to this option or if the argument is
on then validation failures will be considered fatal errors during builds. If the argument is
warn then failures will be treated as warnings.
- Save a copy of the terminal output during each package building
process. By default, the file is stored in
one can use the --logfile flag to specify an alternate filename.
--no-log-output - Don't save a copy of the output during package-building, opposite of the --log-output flag. This is the default.
- Save package build logs to the file
filename instead of the default
file (see the --log-output flag, which is implicitly set by the
--logfile flag). You can use percent-expansion codes to include
specific package information automatically. A complete list of percent-expanions is available in the Fink Packaging Manual; some common percent-expansions are:
- %n - package name
- %v - package version
- %r - package revision
- Consider only packages in trees matching expr.
The format of expr is a comma-delimited list of tree specifica-
tions. Trees listed in
fink.conf are compared against expr. Only
those which match at least one tree specification are considered by
fink, in the order of the first specifications which they match. If
no --trees option is used, all trees listed in
included in order.
A tree specification may contain a slash (/) character, in which
case it requires an exact match with a tree. Otherwise, it matches
against the first path-element of a tree. For example,
--trees=unstable/main would match only the unstable/main tree,
while --trees=unstable would match both unstable/main and
There exist magic tree specifications which can be included in
- status - Includes packages in the dpkg status database.
- virtual - Includes virtual packages which reflect the capabilities of the system.
Exclusion of (or failure to include) these magic trees is currently only supported for operations which do not install or remove packages.
-T, --exclude-trees=expr Consider only packages in trees not matching expr. The syntax of expr is the same as for --trees, including the magic tree specifications. However, matching trees are here excluded rather than included. Note that trees matching both --trees and --exclude-trees are excluded.
Examples of --trees and --exclude-trees:
fink --trees=stable,virtual,status install foo
Install foo as if
finkwas using the stable tree, even if unstable is enabled in
fink --exclude-trees=local install foo
Install the version of foo in Fink, not the locally modified version.
fink --trees=local/main list -i
List the locally modified packages which are installed.
Most of these options are self-explanatory. Many can also be set in the
Fink configuration file (
fink.conf) if you want
to set them permanently and not just for that invocation of
The install command is used to install packages. It downloads, configure, builds and installs the packages you name. It will also install required dependencies automatically, but will ask you for confirmation before it does so. Example:
fink install nedit Reading package info... Information about 131 packages read. The following additional package will be installed: lesstif Do you want to continue? [Y/n]
Use of the --use-binary-dist option with
fink install can speed the build process for complicated packages by quite a lot.
Aliases for the install command: update, enable, activate, use (most of these for historic reasons).
The remove command removes packages from the system by calling '
dpkg --remove'. The current default implementation has a flaw: it
doesn't check dependencies itself but rather completely leaves that to
the dpkg tool (usually this poses no problem, though).
The remove command only removes the actual package files,
(excluding configuration files), but leaves
.deb compressed package file intact. This means that you can
re-install the package later without going through the compile process
again. If you need the disk space, you can remove the
.deb from the
These flags can be used with the fink remove command
-h,--help - Show the options which are available. -r,--recursive - Also remove packages that depend on the package(s) to be removed (i.e. overcome the above-mentioned flaw).
Aliases: disable, deactivate, unuse, delete.
The purge command purges packages from the system. This is the same as the remove command except that it removes configuration files as well.
This command takes the:
This command updates all installed packages to the latest version. It does not need a package list, so you just type:
--use-binary-dist is also useful with this command.
This command produces a list of available packages, listing installation status, the latest version and a short description. If you call it without parameters, it will list all available packages. You can also pass a name or a shell pattern, and fink will list all packages that match.
The first column displays the installation state with the following meanings:
not installed i latest version is installed (i) installed, but a newer version is available p a virtual package provided by a package that is installed
The version column always lists the latest (highest) version known for the package, regardless of what version (if any) you have installed. To see all versions of a package available on your system, use the dumpinfo command.
There are also some flags for the
fink list command
-h,--help Show the options which are available. -t,--tab Output the list in a tab delimited format, useful for running the output through a script. -i,--installed Show only those packages which are currently installed. -o,--outdated Show only those packages which are out of date. -u,--uptodate Show only packages which are up to date. -n,--notinstalled Show packages which are not currently installed. -s expr,--section=expr Show only packages in the sections matching the regular expression expr. -m expr,--maintainer=expr Show only packages with the maintainer matching the regular expression expr. -w=xyz,--width=xyz Sets the width of the display you would like the output formatted for. xyz is either a numeric value or auto. auto will set the width based on the terminal width. The default is auto.
Some usage examples:
fink list - list all packages fink list bash - check if bash is available and what version. fink list --tab --outdated | cut -f 2 - just list the names of the out of date packages. fink list --section=kde - list the packages in the kde section fink list --maintainer=fink-devel - list the packages with no maintainer fink --trees=unstable list --maintainer=fink-devel - list the packages with no maintainer, but only in the unstable tree. fink list "gnome*" - list all packages that start with 'gnome'
The quotes in the last example are necessary to stop the shell from interpreting the pattern itself.
This command behaves almost identical to fink list. The most
notable difference is that
fink apropos also searches
the package descriptions to find packages. The second difference is that
the search string must be supplied and is not optional.
fink apropos irc - list all packages for which 'irc' occurs in the name or description. fink apropos -s=kde irc - the same as above, but restricted to packages from the kde section.
This command displays a description of the package you name on the command line. Note that only a small part of the packages currently have a description.
Aliases: desc, description, info
List the (optional) plugins available to the
fink program. Currently lists the notification mechanisms and the source-tarball
Downloads the named packages, but does not install them. This command will download the tarballs even if they were downloaded before.
The following flags can be used with the
-h,--help Show the options which are available. -i,--ignore-restrictive Do not fetch packages that are "License: Restrictive". Useful for mirrors, because some restrictive packages do not allow source mirroring. -d,--dry-run Just display information about the file(s) that would be downloaded for the package(s) to be fetched; do not actually download anything. -r,--recursive Also fetch packages that are dependencies of the package(s) to be fetched.
Downloads all package source files. Like fetch, this downloads the tarballs even when they were downloaded before.
These flags can be used with the
fink fetch-all command:
-h,--help -i,--ignore-restrictive -d,--dry-run
Downloads all missing package source files. This command will only download files that are not present on the system.
These flags can be used with the
fink fetch-missing command:
-h,--help -i,--ignore-restrictive -d,--dry-run
Builds a package, but does not install it. As usual, the source tarballs are downloaded if they can not be found. The result of this command is an installable .deb package file, which you can quickly install later with the install command. This command will do nothing if the .deb already exists. Note that dependencies are still installed, not just built.
The --use-binary-dist option is applicable here.
Builds a package (like the build command), but ignores and overwrites
the existing .deb file. If the package is installed, the newly created
.deb file will also be installed in the system via
dpkg. Very useful
during package development.
Same as install, but will install the package via
dpkg even when it is
already installed. You can use this when you accidentally deleted
package files or changed configuration files and want to get the
default settings back.
fink configuration process.
This will let you change your mirror sites and proxy settings, among
fink-0.26.0: This command will also let you turn on the unstable trees if desired.
This command automates the process of upgrading to a new Fink
release. It checks the Fink website to see if a new version is
available. It then downloads the package descriptions and updates
the core packages, including
fink itself. This command can upgrade
to regular releases, but it can also setup your
directory tree for direct CVS or rsync updates, if you select one of those options the first time this command is run. This means that you then
will be able to access the very latest revisions of all packages.
If the --use-binary-dist option is enabled, the list of available packages in the binary distribution is also updated.
Use this command to make
fink selfupdate use rsync to update its package list.
This is the recommended way to update Fink when building from source.
Note: rsync updates only update the active trees (e.g. if unstable isn't turned on in
fink.conf the list of unstable packages won't be updated.
Use this command to make
fink selfupdate use CVS access to update its package list.
CVS updating is deprecated, except for developers and those people who are behind firewalls that disallow rsync.
Rebuilds the package cache. You should not normally need to execute
this manually, as
fink should auto-detect when it needs to be updated.
This command performs various checks on
.deb files. Package
maintainers should run this on their package descriptions and
corresponding built packages before submitting them.
The following optional options may be used:
-h,--help - Show the options which are available. -p,--prefix - Simulate an alternate Fink basepath prefix (%p) within the files being validated. --pedantic, --no-pedantic - Control the display of nitpicky formatting warnings. --pedantic is the default.
apt-get database of debs; defaults to updating all of the trees, but may be restricted to a set of one or more trees given as arguments.
Removes obsolete and temporary files. This can reclaim large amounts of disk space. One or more modes may be specified:
--debs - Delete .deb files (compiled binary package archives) corresponding to versions of packages that are neither described by a package description (.info) file in the currently-active trees nor presently installed. --sources,--srcs - Delete sources (tarballs, etc.) that are not used by any package description (.info) file in the currently- active trees. --buildlocks, --bl - Delete stale buildlock packages. --dpkg-status - Remove entries for packages that are not installed from the dpkg "status" database. --obsolete-packages - Attempt to uninstall all installed packges that are obsolete. (new in fink-0.26.0) --all - All of the above modes. (new in fink-0.26.0)
If no mode is specified,
--debs --sources is the default action.
In addition, the following options may be used:
-k,--keep-src - Move old source files to /sw/src/old/ instead of deleting them. -d,--dry-run - Print the names of the files that would be deleted, but do not actually delete them. -h,--help - Show the modes and options which are available.
fink parses parts of a package's
.info file. Various
fields and percent expansions will be displayed according
to options as follows:
-h, --help - Show the options which are available. -a, --all - Display all fields from the package description. This is the default mode when no --field or --percent flags are given. -f fieldname, - Display the given fieldname(s), --field=fieldname in the order listed. -p key, - Display the given percent expansion key(s), --percent=key in the order listed.
Displays a human-readable list of the compile-time (build) and run- time (installation) dependencies of the listed package(s).