Adding Packages and Ports

Matthew Seaman m.seaman at
Mon Feb 2 00:05:12 PST 2004

On Sun, Feb 01, 2004 at 11:21:13PM -0500, Krikket wrote:

> Please correct me if I'm wrong, but the various versions of freeBSD (3.x,
> 4.x, and 5.x) are still being worked.  Needless to say, 5.x is the
> bleeding edge, but 4.x hasn't been left to go stale.  (Or else how would
> security patches get done, when needed?)

FreeBSD 3.x isn't actively supported or worked on any more, although
very occasionally some critical security fixes have been committed to
that branch.  But otherwise, yes, you're right.
> Therefore, the thought was to get the latest and greatest from the
> net.  No, it's not as bleeding edge as the 5.2 stuff, but if a patch was
> done since the 4.9 iso's were made, it would be a good idea to have that
> on hand.  So I thought it would be a good thing to use -r as a default
> option.  Or am I just using an incorrect line of thinking, due to the flux
> that I got used to (and wish to avoid) from when I was dealing with the
> Linux world?

Ports are developed independantly of the base system.  It's a
continuous process of development as new ports get added, updates to
current ports are made to accomodate upstream changes to port
distfiles or to fix bug, and generally as new features appear in the
ports make system.  Testing on ports is done using the currently
supported versions of the OS -- viz. 4.9 and 5.2 -- and while ports
should work on older systems, that cannot be guarranteed.

Each time a release is made, a full set of packages are built from the
ports tree: there's a short period of code freeze before that on the
ports tree when extra effort is put into bug fixing and making
everything work as well as possible together, rather than introducing
new code.  Those packages are what goes onto the FTP sites, and a
sample of the most popular ones go into the install CDs -- there's
*far* too much stuff to fit all of it onto a 4 CD distribution set.

Between releases, where a port is updated, an updated pkg tarball is
eventually uploaded to the ftp servers into the 'Latest' directory,
for each Tier-1 architecture and for both supported OS
versions. pkg_add -r will download that 'Latest' version where
available, or else the version from the release set.  However, pkg
building isn't instantaneous, and you can get hold of the newest stuff
much quicker by building out of the ports tree yourself.

> So, given that I should have the ports installed from my initial install
> phase, all I have to do is the make install clean?  Too cool.  Thank you
> for the pointer!

Absolutely.  Lots of people instinctively head towards the installing
precompiled packages route, but generally I find that installing
through ports is just as easy, usually doesn't take that much more
time (except for some really big compilations, like OpenOffice or
jdk14), and lets you tweak various build options and so forth. Even
so, it's perfectly fine to mix up stuff installed via packages and
stuff installed via ports -- it all comes down to the same package
database in the end.  Using ports also makes it a lot easier to keep
everything maintained and up to date, especially by using the
portupgrade(1) tools.  There are some ports which aren't available as
packages, usually for licensing reasons.

Note that the ports tree you installed is a snapshot of the state at
the time your release was created.  The ports tree has undergone a
great deal of development since then.  There's been a lot of updates
to the 3rd party ported software as well, and some versions current at
that time may not be available any more.  You can track the current
state of the ports tree using cvsup(1) -- exactly as you'ld track the
current state of the system sources.  Details of how to do that are
available in the Handbook:

Nb. the cheats method of getting cvsup(1) working is very quick:

    Step 1: Install the cvsup-without-gui package using pkg_add.  Type
            'rehash' if you're using tcsh(1) as your shell, so that it
            becomes aware of the newly installed binaries.

    Step 2: Edit /etc/make.conf -- create the file if it doesn't
            exist.  You need to add the following:

        SUP_UPDATE=     yes
        SUP=            /usr/local/bin/cvsup
        SUPFLAGS=       -g -L 2
        SUPHOST=                       [1]
        SUPFILE=        /usr/share/examples/cvsup/standard-supfile [2]
        PORTSSUPFILE=   /usr/share/examples/cvsup/ports-supfile

            where [1] should be a cvsup server local to you, and [2]
            as shown will get you the system sources for the same OS
            -RELEASE branch as you installed: eg. 4.9-RELEASE-pN or
            5.2-RELEASE-pN. You can replace that by 'stable-supfile'
            to switch to the 4-STABLE branch, although once you've
            updated to 4-STABLE, the standard-supfile will be replaced
            by one pulling down the 4-STABLE sources.

    Step 3: Update the ports tree sources by:

        # cd /usr/ports
        # make update

            You can similarly update the system and ports sources
            together by doing 'make update' from /usr/src.

            Job done.



Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP:         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url :

More information about the freebsd-questions mailing list