Unix for Mac OS X 10.4 Tiger: Visual QuickPro Guide (2nd Edition)

Using Fink to Install Software

Fink is an open -source system that automates the process of downloading, configuring, compiling, and installing hundreds of Darwin packages (remember, Darwin is the version of Unix at the core of Mac OS X). By "package," we simply mean a piece of software along with its associated documentation and configuration files. Rather than your having to follow all the steps outlined in the previous section, Fink downloads, compiles, and installs a package with a single command (the Fink Web site at http://fink. sourceforge .net/ offers a variety of packages, from games to graphics, available for download, as does the Webmin Web site [www.webmin.com]).

See the sidebar "More About Fink," for late-breaking news about the program.

To install Fink, start by downloading the software. Fink comes precompiled, so you don't have to compile it to use it.

To install Fink:

1.

From your Web browser, open the Fink download page:

http://fink.sourceforge.net/download

2.

Click the link to download the latest version of the installer disk image (a file that, when mounted as a disk, contains the installation program for a particular piece of software).

Figure 13.1 (showing how the Web page for downloading Fink appeared during production of this book) highlights the link to click. The Web page you get may be a bit different, but note that there is a list of different versions of Fink for different versions of Mac OS X.

Figure 13.1. The Fink download page. The file you want to download is the "installer disk image." Note that there are different versions of Fink for different versions of Mac OS X.

Fink and X Windows

Many of the packages available for installation with Fink rely on the X Windows system. X Windows is a large collection of software that provides a platform-independent graphical user interface (GUI) environment. Most Unix software that provides a GUI relies upon X Windows to handle the creation of windows, dialogs, and buttons . Apple's version of X Windows is on your Mac OS X installation DVD (or CDs) and is also available for no charge at the X11 page (www.apple.com/macosx/features/x11).

Follow the download instructions and save the file on your system's hard disk.

Depending on your browser configuration, the disk image may be automatically mounted. If not, double-click the disk-image file in the Finder to mount it. You should end up with a Finder window that looks similar to Figure 13.2 .

Figure 13.2. A Finder window showing the Fink Installer disk image, mounted as if it were a disk. You see the Fink installer package and associated files.

3.

Double-click the Fink Installer.pkg file to launch the Fink installation program. In Figure 13.2, it's the icon labeled Fink 0.8.0 Installer.pkg. You get a standard Mac OS X software installer window ( Figure 13.3 ).

Figure 13.3. Double-clicking the Fink Installer.pkg icon launches the installer program.

The dialog that drops down asks you about running a program to determine if the installation will work.

4.

Click the Continue button in the dialog. The dialog goes away.

5.

Click the Continue button in the lower right-hand corner of the window.

You see the Read Me information for Fink ( Figure 13.4 ). Read it. It may have important information about the latest version.

Figure 13.4. The Read Me pane of the Fink installer.

6.

Click the Continue button.

You see the Software License Agreement. Read it. Note that Fink is licensed under the GNU General Public License (GPL), which we mentioned in Chapter 1, "What Is Unix, and Why Is It Good?" The GPL says that you may use Fink without any cost or obligation. However, if you redistribute Fink, you are obligated to make the source code available to all those to whom you distribute it.

7.

Click the Continue button.

You get a dialog asking if you agree with the software license agreement ( Figure 13.5) .

Figure 13.5. A dialog appears, asking if you agree to the software license.

8.

Click Agree to accept the license terms.

The installer switches to the Select a Destination pane, which asks you to select a disk on which to install Fink ( Figure 13.6 ).

Figure 13.6. If you agree to the license terms, the Select a Destination pane opens; you choose the installation volume for Fink here.

If you have more than one volume showing, click the one you want to use. We recommend installing Fink on the boot volume.

If you do not agree to the license terms, you may not use the software. Click Disagree and quit the installer.

9.

Click the Continue button.

You see the Installation Type pane ( Figure 13.7 ). This is here just to give you a chance to confirm before the installation proceeds.

Figure 13.7. In the Installation Type pane, your choices are Install and Go Back.

10.

Click the Install button.

The Authenticate window opens, asking you to enter your password because the installer is going to run as root ( Figure 13.8 ).

Figure 13.8. The Authenticate window, where your name is already filled in.

11.

Enter your password and click the OK button.

Throughout this book we assume you are logged in as an admin user, if not, then you must use the name and password of an admin account, not your own.

Click the Continue button in the lower right-hand corner of the Install pane; the installation begins ( Figure 13.9 ).

Figure 13.9. The Fink installation in progress.

When the installer has finished, the progress bar is complete and the Close button is highlighted ( Figure 13.10 ).

Figure 13.10. When the installation is done, the progress bar is filled; click Close to finish.

12.

Click Close to finish the installation.

The installer creates a new directory called sw on the volume you selected. If you selected the boot volume, Fink is installed in /sw (which is what we recommend). If you installed Fink on any volume other than your system-startup volume, you must make a symlink called /sw that points to the installed location. For example, if you installed Fink on a partition called Extra Disk, you will create the symlink at the command line with

sudo ln -s "/Volumes/Extra Disk/sw /sw

(Review Chapter 5, "Using Files and Directories," for details on symlinks .)

Fink is now installed.

If you have the Terminal application open, we suggest quitting and restarting it to make sure your shells pick up the new Fink configuration (see the tip, next page).

Tip

The next step is to configure Fink as root from the command line. In order to automate the process of downloading, compiling, and installing software, Fink needs to know some things about how your computer is connected to the Internet.

To configure Fink:

1.

sudo fink configure

Fink must be configured as root, so you use the sudo command to run fink configure (see Chapter 11). You are asked for your password ( Figure 13.11 ).

Figure 13.11. You are asked for your password to enable the sudo command.

localhost:~ vanilla$ sudo fink configure Password:

2.

Enter your password, and press .

Fink asks a series of questions. The default answers will appear inside square brackets ( [ ] ), and in many cases the default will be nothingthat is, there will be nothing inside the square brackets. That's OK. Unless you know that the answer should be different from the default, press to accept.

Figure 13.12 shows the questions asked by version 0.8.0 of Fink. In the example we have accepted all the defaults.

Figure 13.12. Fink asks you a series of questions. In this example we are accepting the default for every questionso we pressed for each one.

localhost:~ vanilla$ sudo fink configure Password: OK, I'll ask you some questions and update the configuration file in '/sw/etc/fink.conf'. In what additional directory should Fink look for downloaded tarballs? [ ] Which directory should Fink use to build packages? (If you don't know what this means, it is safe to leave it at its default.) [ ] Should Fink try to download pre-compiled packages from the binary distribution if available? [Y/n] (1) Quiet (do not show download statistics) (2) Low (do not show tarballs being expanded) (3) Medium (will show almost everything) (4) High (will show everything) How verbose should Fink be? [2] Proxy/Firewall settings Enter the URL of the HTTP proxy to use, or 'none' for no proxy. The URL should start with http:// and may contain username, password or port specifications. E.g: http://username:password@hostname:port [none] Enter the URL of the proxy to use for FTP, or 'none' for no proxy. The URL should start with http:// and may contain username, password or port specifications. E.g: ftp://username:password@hostname:port [none] Use passive mode FTP transfers (to get through a firewall)? [Y/n] Mirror selection All mirrors are set. Do you want to change them? [y/N] Writing updated configuration to '/sw/etc/fink.conf'... localhost:~ vanilla$

Tips

Figure 13.13. The Fink configuration file, /sw/etc/fink.conf .

# Fink configuration, initially created by bootstrap.pl Basepath: /sw RootMethod: sudo Trees: local/main stable/main stable/crypto Distribution: 10.4-transitional Mirror-apt: http://bindist.finkmirrors.net/bindist Mirror-cpan: ftp://ftp.funet.fi/pub/languages/perl/CPAN/ Mirror-ctan: ftp://tug.ctan.org/tex-archive/ Mirror-debian: ftp.debian.org Mirror-gimp: ftp://ftp.gimp.org/pub/gimp/ Mirror-gnome: ftp://ftp.gnome.org/pub/GNOME/ Mirror-gnu: ftp://ftp.gnu.org/gnu Mirror-kde: ftp://ftp.kde.org/pub/kde/ Mirror-master: http://distfiles.master.finkmirrors.net/ Mirror-rsync: rsync://master.us.finkmirrors.net/finkinfo/ Mirror-sourceforge: http://west.dl.sourceforge.net/sourceforge/ MirrorContinent: nam MirrorCountry: nam-us MirrorOrder: MasterFirst ProxyPassiveFTP: true UseBinaryDist: true Verbose: 1

Figure 13.14. Using fink --help to get a summary of available commands and options.

localhost:~ vanilla$ fink --help Fink 0.23.10 Usage: fink [options] command [package...] fink install pkg1 [pkg2 ...] Common commands: install - install/update the named packages remove - remove the named packages purge - same as remove but also removes all configuration files update - update the named packages selfupdat - upgrade fink to the lastest release update-all - update all installed packages configur - rerun the configuration process list - list available packages, optionally filtering by name, see 'fink list help' for more options apropos - list packages matching a search keyword describe - display a detailed description of the named packages index - force rebuild of package cache validate - performs various checks on .info and .deb files scanpackages - rescans the list of binary packages on the system cleanup - removes obsolete package files if newer versions are available dumpinfo - show how fink parses parts of a package's .info file show-deps - list run-time and compile-time package dependencies Options: -h, --help - display this help text -q, --quiet - causes fink to be less verbose, opposite of verbose -V, --version - display version information -v, --verbose - causes fink to be more verbose, opposite of quiet -y, --yes - assume default answer for all interactive questions -b, --use-binary-dist - download pre-compiled packages from the binary distribution if available --no-use-binary-dist - don't use pre-compiled packages from the binary distribution (opposite of -b) See the fink(8) manual page for more commands and options. Visit http://fink.sourceforge.net/ for further information.

More About Fink

The Fink Web site is at http://fink.sourceforge.net.

Fink has an HTML user's guide, which is included in the installation disk image. You can open the file with a Web browser. The user's guide is also available online at http://fink.sourceforge.net/doc.

You can find links to mailing lists about Fink at http://fink.sourceforge.net/lists.

Now that you have Fink installed and configured, let's start using it.

Fink can show you all of the software packages available for installation. New software packages are added to the list frequently.

To list available packages:

Tips

To list only installed packages:

Now the fun part: actually installing a package using Fink. We'll install the wget program as an example. wget is a command-line tool for retrieving files from Web sites and FTP sites. Mac OS X comes with a similar command, curl , but in our opinion wget is much easier to use.

To install a package using Fink:

1.

fink install wget

You must be root to install software with Fink, so it will automatically invoke sudo behind the scenes and you will be prompted for your password.

Fink automatically downloads, compiles, and installs the software.

Figure 13.17 shows typical output for the entire process of Fink downloading and installing wget .

Figure 13.17. Using Fink to download and install the wget program.

localhost:~ vanilla$ fink install wget Password: Information about 1766 packages read in 2 seconds. The following package will be installed or updated: wget /sw/bin/apt-get -q --ignore-breakage --download-only install wget=1.8.2-2 Reading Package Lists... Building Dependency Tree... The following NEW packages will be installed: wget 0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 346kB of archives. After unpacking 1249kB will be used. Get:1 http://bindist.finkmirrors.net 10.4-transitional/release/main wget 1.8.2-2 [346kB] Fetched 346kB in 3s (105kB/s) Download complete and in download only mode dpkg -i /sw/var/cache/apt/archives/wget_1.8.2-2_darwin-powerpc.deb Selecting previously deselected package wget. (Reading database ... 4090 files and directories currently installed.) Unpacking wget (from .../wget_1.8.2-2_darwin-powerpc.deb) ... Setting up wget (1.8.2-2) ... * Wget: (wget). The non-interactive network downloader. install-info(/sw/share/info/wget.info): creating new section `Net Utilities' localhost:~ vanilla$

The amount of time involved will depend on the speed of your Internet connection and of your computer.

You will get a shell prompt when Fink is done. The software is now installed.

2.

Try using the newly installed software:

wget http://www.matisse.net/files/ glossary.html

This retrieves my Glossary of Internet terms and saves it in your current directory as glossary.html ( Figure 13.18 ). See man wget for details on wget .

Figure 13.18. Using the newly installed wget command to retrieve and save a document.

localhost:~ vanilla$ wget http://www.matisse.net/files/glossary.html --08:34:02 http://www.matisse.net/files/glossary.html => `glossary.html' Resolving www.matisse.net... done. Connecting to www.matisse.net[216.135.166.2]:80... connected. HTTP request sent, awaiting response... 200 OK Length: 115,145 [text/html] 100%[====================================>] 115,145 1.23M/s ETA 00:00 08:34:02 (1.23 MB/s) - `glossary.html' saved [115145/115145] localhost:~ vanilla$

Tips

The database that Fink uses for package information contains short descriptions of the available packages. You can see a package description with the fink describe command.

To show details about a package:

To search for packages by keyword:

Updating and removing packages with Fink

One of the most excellent (dude!) features of Fink is the ease with which you can use it to update installed packages.

Updating a package in Fink is simply a matter of using the fink update command. You can update a single package by specifying a package name on the command line, but even cooler is the fact that you can update all installed packages with the fink update-all command.

Fink also makes it easy to have it update itself and to remove any package installed with it. Table 13.1 summarizes the commands for updating and removing packages installed with Fink.

Table 13.1. Updating and Removing Packages with Fink

A CTION

C OMMAND

Update a specific package

fink update package

Update all installed packages

fink update-all

Update Fink itself

fink selfupdate

Remove a package

fink remove package

Категории