Thursday, July 29, 2010

FreeBSD, Fully Loaded

Now my FreeBSD system is fully up: ZFS is running, Samba configured, Openoffice installed.

Hence FreeBSD is my latest toy, and I believe I am gonna say good bye to OpenSolaris from now on.

FreeBSD is not for the faint of heart, especially those who don't know or don't want to use command line. I installed FreeBSD from the CD version, and when it was first loaded, there was basically nothing in the box - no X, not even bash.

However the BSD ports system is a charm to use, as long as you have broadband, it is much more user-friendly than OpenSolaris, and can even beat Ubuntu hands down.

Here are some basic stuff:

Suppose you want to install firefox, you have two choices: install the pre-compiled one, or compile and install from source.

1. Precompile Binary

There are multiple sources for precompiled binary packages, the easiest way is to issue:

pkg_add -r firefox

That is it. If the system can find firefox, it will be automagically installed.

If the package is not available at the default location, just google around and you should be able to get most of the popular packages pre-compiled.

2. Compile from Source
In the '/usr/ports' directory, software packages are divided into their functional group, e.g. editor, audio, news, etc. Inside those folders will be folders for individual software packages.

Taking the firefox example, we can get it from '/usr/ports/www/firefox', change directory there, and issue:

make install clean

The above command in effect will download, compile, and install the package (effect of 'install'), while the 'clean' command will remove all the intermediate files.

Do note I highly suggest you always try to install pre-compiled binary, and only if you cannot find the pre-compiled binary, or the binary doesn't suit your need, then you roll your own stuff. Compilation is a _long_ process. I did that for OpenOffice, the machine ran for 4 hours non-stop, to the point I gave up and downloaded the compiled version (just google around).

No comments: