Chapter 8. Unix-Based Internet Tools

If you’re going to be interacting with the Internet extensively, odds are good that you’ll opt for attractive and easy-to-use Aqua applications. Bear with us, though; there’s a lot of power in the Unix command-line alternatives, and they’re well worth learning.

Fink

The Fink Project is made up of volunteers who are bringing open source software to Mac OS X. They do the work that is needed to make these programs run smoothly and keep them updated so they work with the latest release of Mac OS X.

Two of the programs featured in this chapter, Lynx and Pine, are available through Fink, as is a wealth of other applications. To install Fink, do the following:

  1. Download the binary installer disk image (a .dmg file) from http://fink.sourceforge.net/download.

  2. In the Finder, double-click the .dmg file to mount the disk image.

  3. Open the mounted disk image and double-click the Fink Installer .pkg package inside.

  4. Follow the instructions on the screen.

Tip

You can also find an installer for Lynx and Pine by selecting the “Get Mac OS X Software...” menu from the Apple menu, which opens a web browser and takes you to the Apple web site. From there, find and click on the “Unix & Open Source” link, which offers a list of useful Unix applications, including Lynx and Pine. The advantage of using Fink is that it will manage thousands of available packages, making sure that you have the latest versions and that different packages cooperate with each other.

To begin using Fink, you need to set up your PATH and some environment variables. Fink provides a shell script to help with this. Add this command to your .tcshrc file (see Section 3.3.2):

source /sw/bin/init.csh

Next, close your Terminal window and open a new one. You won’t notice anything different, but the addition of the command will configure future Terminal sessions for Fink. After you’ve installed Fink and started a new Terminal session, you can use the apt-get utility to install Lynx and Pine. When you issue the apt-get command, you must use sudo (see Section 2.3) so you can make changes to the system.

Installing Packages

After you’ve done a fresh install of Fink, you must update the list of available packages with apt-get update (you should also run this command every couple of weeks to see if any new packages have been released):

% sudo apt-get update
Password:
Get:1 http://us.dl.sourceforge.net release/main Packages [112kB]      
Get:2 http://us.dl.sourceforge.net release/main Release [85B]
Get:3 http://us.dl.sourceforge.net release/crypto Packages [9247B]
Get:4 http://us.dl.sourceforge.net release/crypto Release [87B]
Get:5 http://us.dl.sourceforge.net current/main Packages [112kB]
Get:6 http://us.dl.sourceforge.net current/main Release [85B]
Get:7 http://us.dl.sourceforge.net current/crypto Packages [9247B]
Get:8 http://us.dl.sourceforge.net current/crypto Release [87B]
Fetched 243kB in 1s (207kB/s)               
Reading Package Lists... Done
Building Dependency Tree... Done

After you’ve done this, you can use the apt-get install command to install Lynx:

% sudo apt-get install lynx 
Reading Package Lists... Done
Building Dependency Tree... Done
The following NEW packages will be installed:
  lynx 
0 packages upgraded, 1 newly installed, 0 to remove and 0  not upgraded.
Need to get 1319kB of archives. After unpacking 0B will be used.
Get:1 http://us.dl.sourceforge.net release/main lynx 2.8.4-1 [1319kB]
Fetched 1319kB in 11s (120kB/s)
Selecting previously deselected package lynx.
(Reading database ... 3450 files and directories currently installed.)
Unpacking lynx (from .../lynx_2.8.4-1_darwin-powerpc.deb) ...
Setting up lynx (2.8.4-1) ...

Tip

http://finkcommander.sourceforge.net/ is home to FinkCommander, a free graphical user interface for Fink. Use this program if you’d rather have an Aqua interface to maintain your Fink installation.

When you use apt-get to install a package, Fink searches a web site for a pre-built package provided by the volunteers. A pre-built package is an application that has been bundled up in a manner similar to the installers used by other Mac OS X applications. As of this writing, there was no binary package for Pine. However, if you’ve installed the Mac OS X Developer Tools (see The Mac OS X Developer Tools), you can use the fink install command to automatically download, compile, and install an application:

% fink install pine
sudo /sw/bin/fink  install pine
Password:
Information about 1710 packages read in 3 seconds.

pkg pine  version ###
pkg pine  version 4.44-2
The following package will be installed or updated:
 pine
[... output deleted for brevity ...]

The fink install command performs a lot of actions on your behalf: downloading source code, locating patches (modifications to the source code that provide Mac OS X compatibility), compiling the source, and installing the compiled programs. This process can take a long time, depending on which packages you have selected. If you select a package that depends on another package, fink will automatically install it. If there are many dependencies between packages, you could be in for a long wait.

For this reason, it’s best to use apt-get to install packages whenever possible. Since apt-get uses precompiled packages, you don’t have to download all the source and wait for compilation. Also, apt-get warns you if there are any dependencies, and gives you a chance to abort:

% sudo apt-get install ethereal
Password:
Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
  dlcompat glib glib-shlibs gtk+ gtk+-data gtk+-shlibs libpcap
  libpcap-shlibs system-xfree86 zlib 
The following NEW packages will be installed:
  dlcompat ethereal glib glib-shlibs gtk+ gtk+-data gtk+-shlibs
  libpcap libpcap-shlibs system-xfree86 zlib 
0 packages upgraded, 11 newly installed, 0 to remove and 0  not upgraded.
Need to get 13.7MB of archives. After unpacking 0B will be used.
Do you want to continue? [Y/n]

Listing Available Packages

To see a list of available packages, use the command fink list (this sample shows an abbreviated list):

% fink list
Information about 1710 packages read in 1 seconds.

     3dpong           0.4-2        Pong clone
     a2ps             4.12-4       Any to PostScript filter
 i   aalib            1.4rc5-2     Ascii art library
 i   aalib-bin        1.4rc5-2     Ascii art library
 i   aalib-shlibs     1.4rc5-2     Ascii art library
     abiword          1.0.2-2      Open-source word processor

An i in the leftmost column indicates that the package is already installed. The second column is the package name to use with apt-get install. The third column shows the version number, and the last column provides a description of the package.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.82.93