Fink

User's Guide - 6. Using the fink Tool from the Command Line

6.1 Using the fink tool

The 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 fink tool:

6.2 Global options

There are some options, which apply to all fink commands. If you type fink --help you get the list of options:

(as of fink-0.26.0)

-h, --help - displays help text.

-q, --quiet - causes fink to be less verbose, opposite of --verbose. Overrides the Verbose flag in fink.conf.

-V, --version - display version information.

-v, --verbose - causes fink to be more verbose, opposite of --quiet. Overrides the Verbose field in fink.conf.

-y, --yes - assume default answer for all interactive questions.

-K, --keep-root-dir - Causes fink not to delete the root-[name]-[version]-[revision] directory in the Buildpath after building a package. Corresponds to the KeepRootDir field in fink.conf.

-k, --keep-build-dir - Causes fink not to delete the [name]-[version]-[revision] directory in the Buildpath after building a package. Corresponds to the KeepBuildDir field in fink.conf.

-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 fink.conf.

--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 the 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.

-m, --maintainer - (fink-0.25 and later) Perform actions useful to package maintainers: run validation on the .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 on.

--tests[=on|off|warn] - (fink-0.26.0 and later) Causes InfoTest fields to be activated and test suites specified via 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 warn then failures will be treated as warnings.

--validate[=on|off|warn] - 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.

-l, --log-output - Save a copy of the terminal output during each package building process. By default, the file is stored in /tmp/fink-build-log_[name]-[version]-[revision]_[date]-[time] but 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.

--logfile=filename - 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:

-t, --trees=expr - 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 fink.conf are 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 unstable/crypto. There exist magic tree specifications which can be included in expr:

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:

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 fink.

6.3 install

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).

6.4 remove

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 the .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 /opt/sw/fink/dists tree.

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.

6.5 purge

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:

-h,--help
-r,--recursive

options.

6.6 update-all

This command updates all installed packages to the latest version. It does not need a package list, so you just type:

fink update-all

--use-binary-dist is also useful with this command.

6.7 list

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.

6.8 apropos

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.

6.9 describe

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

6.10 plugins

List the (optional) plugins available to the fink program. Currently lists the notification mechanisms and the source-tarball checksum algorithms.

6.11 fetch

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 fetch command:

-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.

6.12 fetch-all

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

6.13 fetch-missing

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

6.14 build

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.

6.15 rebuild

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.

6.16 reinstall

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.

6.17 configure

Reruns the fink configuration process. This will let you change your mirror sites and proxy settings, among others.

New in fink-0.26.0: This command will also let you turn on the unstable trees if desired.

6.18 selfupdate

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 /opt/sw/fink/dists directory tree for direct git 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.

6.19 selfupdate-rsync

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.

6.20 selfupdate-git

Use this command to make fink selfupdate use Git access to update its package list.

Rsync updating is preferred, except for developers and those people who are behind firewalls that disallow rsync.

6.21 index

Rebuilds the package cache. You should not normally need to execute this manually, as fink should auto-detect when it needs to be updated.

6.22 validate

This command performs various checks on .info and .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.

Aliases: check

6.23 scanpackages

Updates the 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.

6.24 cleanup

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 /opt/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.

6.25 dumpinfo

Shows how 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.
      

6.26 show-deps

Displays a human-readable list of the compile-time (build) and run- time (installation) dependencies of the listed package(s).