Updating Fink


Linking Commands

You probably already know that you can link two or more shell commands in sequence using a semicolon (;) between the commands. For example, the sequence

 echo Your files: ; ls 

will print Your files: and then the output of the ls command.

You can also link commands with || or && (two pipe symbols or two ampersands).

Commands linked with || are executed until one of them succeeds. Commands linked with && are executed until one of them fails.

For example, the sequence

 echo hello || true || echo there 

will print hello and stop, because there's no need to continue. If echo was able to print something, it succeeds.

With this sequence,

 echo hello && true && echo there 

you will see hello on one line, and then there on the next line. The true command always succeeds, so the shell continues to execute the commands in the sequence.

Use || in a command sequence when you only need one of the commands to succeed.

Use && in a command sequence when you want to stop executing commands as soon as something fails.


With Fink (and possibly some packages) installed, you'll want to stay up-to-date. Security problems and other bugs get fixed, features get added, and software evolves, after all.

The selfupdate and update-all commands keep Fink and its packages (respectively) up-to-date. They'll download, compile, and install everything; you just need to enter the commands once in a while.

Unless you know that a specific package you use has been updated, using selfupdate and update-all once a month is probably enough.

To update Fink and all of the installed packages

1.

In a Terminal window, enter the following command:

 fink selfupdate && fink update-all 

This command will update Fink itself, and then, if that was successful, update all of the installed packages.

These commands require an administrator account, so the sudo command will prompt you for your password.

2.

Enter your password at the Password prompt, and then press Enter.

Fink searches for an updated version of itself and installs it (if one exists). Then it searches for updated versions of the installed packages and installs those as well.

Yes, only one command to update Fink and all of your installed packages. OK, technically it's two commands, but it's only one line in the shell.

Finding useful bits in Fink

If this is your first time installing Fink, and your Mac OS X system is still fairly fresh, you probably want to install a bunch of your favorite Unix applications.

To list Fink's packages

  • Use this command to list all of the available Fink packages so that you can find the ones you want:

     fink list | less 

    The list is quite long (almost 2000 packages as of this writing!) and growing all the time.

Installing Fink packages

After you've gone through Fink's extensive package list, you can install the packages you can't live without.

To install Fink packages

1.

Use the fink install command to install one or more packages. For example,

 fink install file wtf zip 

installs the useful file, wtf, and zip packages.

sudo displays the Password prompt.

2.

Type your password, then press Enter.

3.

If the listed packages require any additional packages, such as libraries, Fink will list them and ask if you want to continue. Press Enter to continue.

Fink downloads, compiles, and installs the specified packages.



    Unix Advanced. Visual QuickPro Guide
    Unix Advanced: Visual QuickPro Guide
    ISBN: 0321205499
    EAN: 2147483647
    Year: 2003
    Pages: 116

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net