Enterprise Software

Installing development tools with fink

Developers should take note of Fink, a collection of open source programs built for OS X. Vincent Danen explains the basics of working with Fink.

Fink is a collection of open source programs built for OS X. These programs are largely available on Linux, and on Windows via Cygwin. Another similar system for OS X is Mac Ports, which uses a ports system similar to FreeBSD's port system. Fink uses DEB packages and is more similar to Debian's package management style, although the Fink front-end to build the .deb packages is unique and quite robust.

As a result, Fink makes it easy to get development tools on the Mac. With it, you can install server programs like MySQL and Apache, or development tools like Subversion and Git. Fink makes the installation of, and continued upgrading, of these tools extremely simple.

Once Fink is installed, you can obtain a list of all available packages that Fink can provide:

$ fink list | less

As you page through this list, you will quickly realize the huge number of packages that Fink provides, for all kinds of things. Want to use a command-line email client? Fink provides mutt. How about IRC? BitchX and irssi are both available. Need a command-line HTTP client? Take your pick from lynx, elinks, or w3m. In fact, with Fink you can even install the entire KDE4 or GNOME desktops, which will run on OS X under the X11 window system. As of this writing, there are well over 11,000 packages that can be installed via Fink.

Keeping Fink up-to-date is important, and this can easily be done by issuing:

$ sudo fink selfupdate
$ sudo fink update-all

This will first update Fink itself and its information files, then will update any of the already-installed packages to the latest available versions. This is ideal because it gives you a single command to update all of the packages on your system that Fink installed. Also, don't be afraid to install things that already exist on the system; if the OS X-provided version of Ruby or Python is too old, you can install it via Fink and use that version instead.

Since Fink installs everything into the /sw/ directory, simply change the PATH settings in ~/.bashrc or ~/.zshrc to search /sw/ before other directories:

source /sw/bin/init.sh
export PATH="/sw/bin:/sw/sbin:${HOME}/bin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:

If you don't know where to begin but want to, for instance, install Subversion on your system, you would use:

$ fink apropos svn
Information about 9180 packages read in 1 seconds.
     cvs2svn                     1:2.3.0-2             CVS to SVN/git/bzr/hg repository converter
     cvs2svn-py25                1.5.1-11              Python modules for cvs2svn (Python 2.5)...

From the resulting list, select the package(s) you want to install and use the "install" command:

$ fink install svn

If an up-to-date .deb package is available that meets the requirements of your version of OS X, it will be installed. If not, Fink will download the appropriate source and control files to compile it, then keep the resulting .deb packages stored locally. This way, for instance, if you had previously installed git, then later realized you wanted git-svn, Fink will look for the already-compiled version and install the .deb file that had been created the last time it was compiled.

For Python, Perl, or Ruby developers, Fink is awesome. A number of additional Perl, Python, and Ruby libraries are available via Fink. Instead of having to compile these extras by hand, Fink is on-hand to do the heavy lifting for you.

Many of the applications available on Linux are available via Fink. Sure, using programs under X11 is not quite the same as using something native, but it isn't horrendous either. It is very similar to how Safari feels — like it is a native piece of Aqua goodness, but Firefox feels out of place by how it works and looks. This is how running programs under X11 will feel... it's a little strange, but given what additional applications you can run on OS X, it's worth the cosmetic differences.


Vincent Danen works on the Red Hat Security Response Team and lives in Canada. He has been writing about and developing on Linux for over 10 years and is a veteran Mac user.

Editor's Picks