Neal Parikh

  • Home
  • Notes
  • Quotes
  • About









Setting up Fink on Mac OS X 10.2 (Jaguar)

Setting up Fink is a two-step process. First, you need to install the actual software. Second, you need to set it up so that it will work as best it can.

A quick formatting note before I begin: stuff from Terminal is in teletype font, and user input is colored in blue.

Installing

These instructions are adapted from Fink's Jaguar install guide, which you can also follow.

1. Make sure you are running Mac OS X 10.2 (preferably the latest version) and have the latest Developer Tools installed. The Developer Tools are required for Fink to work. You can download the latest tools for free by registering for an ADC Online account at Apple Developer Connection. Older Mac OS X 10.2 tools will work, but the 10.1 tools will be entirely nonfunctional. 10.1 used the gcc 2.x compiler, while 10.2 uses the gcc 3.1 compiler. You can check whether you're running recent enough tools by running the following in a Terminal window and comparing the output:

% gcc -v
Reading specs from /usr/libexec/gcc/darwin/ppc/3.1/specs
Thread model: posix
Apple Computer, Inc. GCC version 1175, based on gcc version 3.1 20020420 (prerelease)

2. Download Fink and open the .dmg disk image. Run the installer (it will run in Installer.app -- it's a GUI installer).

Setting Up

1. Fink is installed in /sw to keep it separate from the system, and since /sw is not in the default $PATH environment variable, it needs to be added. Run the following command:

% echo "source /sw/bin/init.csh" >> ~/.tcshrc
% source ~/.tcshrc

Note: If you use bash or zsh, use /sw/bin/init.sh. Also, if you're comfortable with Unix editors, you can just add source /sw/bin/init.csh to your ~/.tcshrc yourself with vi, emacs, pico, whatever. It's also worth noting that you can use ~/.cshrc instead of ~/.tcshrc, but the ~/.cshrc file is not read if a ~/.tcshrc file is present. In short, it's less hassle to just use ~/.tcshrc for everything, but if you must, make sure that either there is no ~/.tcshrc or that it sources ~/.cshrc at some point.

To make sure the Fink init script has been properly read, run the following and compare it with the output below:

% echo $PATH
/sw/bin:/sw/sbin:/usr/local/bin:/usr/local/sbin:
/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin:
/usr/local/teTeX/bin/powerpc-apple-darwin-current

The main thing here is that /sw/bin and /sw/sbin are there at the front. (Also, I've broken that up into three lines for readability, but it will all be printed out as one on your screen.)

2. Add the unstable tree to your Fink configuration. The unstable tree is not really just where the Fink maintainers stick all the unstable software; it's just where new software is put for testing. I recommend using the unstable tree because much more software is available with it, and I've had excellent experiences with packages from the unstable tree. Also, if you submit reports to the maintainer that a package is actually unstable, it can help them fix it, which makes the Fink experience better for everyone. Run the following to start editing fink.conf, the main Fink configuration file.

% sudo pico /sw/etc/fink.conf
Password: [enter your admin password here]

Change the line that starts with "Trees:" to look like the following:

Trees: local/main stable/main stable/crypto local/bootstrap unstable/main unstable/crypto

Note: If you are outside the United States, leave out stable/crypto and unstable/crypto, because some of that software cannot be exported outside the US. Also, the "Trees" line above should be all on one line in your Fink conf file.

3. Get all the latest Fink packages.

% fink selfupdate-cvs

4. You're done! If everything doesn't work as planned, feel free to stop by and ask questions on #macnn at irc.macnn.com (MacNN IRC info) or ask in the official Fink channel (#fink) at irc.freenode.net. Remember to check the Fink Documentation first, though.

Introduction to Using Fink

Well, what's the point of installing something if you don't know any neat things to do with it? =) A lot of people ask me how to install Irssi, a modular command-line IRC client, so I'll cover installing that first. To make Irssi run best (due to some short-comings of the default OS X terminal setup), it needs to run inside screen. So let's begin by installing them both with Fink:

% fink install irssi screen

(A digression -- after this, run irssi in screen by running screen irssi on the command line. To make this quicker to access, add alias irc 'screen irssi' to your ~/.tcshrc file and then just use irc.)

So, in general, use fink install <package_name(s)> to install something. But how do you know what the name of the package is called? Use fink list. Here are some interesting list options you can use:

List all the available packages: fink list
List all the installed packages: fink list -i
List all outdated packages that need updating: fink list -o
List all the packages of a certain type: fink list -s=<section>
Search for packages containing "string": fink list string
List all packages starting with string: fink list "string*"

Fink's listing will print out packages in this kind of formatting, and it's important to know what it means:

 i   libpng           1.0.12-6     PNG image format handling library
 i   libpng-shlibs    1.0.12-6     PNG image format handling library
(i)  libpoll          1.2-3        SysV poll(2) Emulation Library
(i)  libpoll-shlibs   1.2-3        SysV poll(2) Emulation Library

The 'i' at the beginning means that the package is installed and up to date. The '(i)' means that the package is installed, but a newer version is available. The second column is obviously the package name, and the third column is the package version number. In the case of libpoll, the version of libpoll itself is 1.2, and it's the 3rd revision of the package file in Fink. Finally, there's a short description of what the package is. To update (for example) libpoll to the latest version, you would simply run fink update libpoll. But what if you have a whole bunch of packages that need updating? In that case, run fink update-all, which will update all the outdated packages you have installed.

To get more information about a package, use fink info package_name. Another useful -- and entirely necessary -- command is fink selfupdate-cvs. You should definitely run this fairly often (once every 2-4 weeks, at the least), because this updates all your local Fink packages to the latest versions straight from the Fink CVS repository; if you don't do this, you'll never be able to install new versions of software, and you won't be exposed to all the newest software that's being ported to Fink. Also, if you wait too long, when you do run it, you'll be waiting a LONG time, because it's going to have to updates hundreds and hundreds of packages.

That's pretty much all you need to use Fink effectively. Further reading: the fink(1) manpage, the online Fink documentation, and the main Fink page, which generally carries important news about the project. I'll end by listing some of the more interesting/fun/useful packages I've come across (and you can find out what they are by yourself, since now you know how ;-)): cmatrix, cowsay, dict, figlet, fortune-mod, fileutils, gnuplot, irssi, latex2html, launch, ncftp, nmap-nox, perltidy, pstree, tcpflow, vim-nox, w3m-ssl, wget, wtf. Enjoy!

Comments? Suggestions? Email me!