Wednesday, August 20, 2008

FreeBSD 101 - Ports

This is probably one of the advantage of FreeBSD among other unix like operating systems. Installing or adding software packages is made easy through FreeBSD port collection. You can install a new software package in FreeBSD by going to the ports directory /usr/ports. If for example you want to install perl version 5.8, you go to /usr/ports/lang/perl5.8. Then type the following commands:
# make 
...
# make install
...

Or you type it in one line:
# make ; make install 


If you happen to install FreeBSD without the port collection, you can install it using portsnap. Follow these easy steps:

# mkdir /usr/ports
# pkg_add -r portsnap
# portsnap fetch
# portsnap extract

Your first step is to create first your ports directory if it does not exist yet, then you install portsnap, next is you download the ports collection and lastly, you install a new ports collection.

There are other ways to install FreeBSD port collection, first you can use sysinstall which is simpler to do than portsnap(oppsss!) or you can use cvsup method.

No comments: