HOWTO: keeping FreeBSD's base system and packages up-to-date

Slawomir Wojtczak (vermaden) is just another busy sysadmin with interest towards UNIX and BSD systems (mostly FreeBSD), often forced to also work on Linux. KISS principle follower. Active troll at many BSD, UNIX and Linux forums.


What You should know:

  • Knowledge about upgrading/updating FreeBSD's base system (check http://freebsd.org/handbook/updating-upgrading.html chapter from FreeBSD Handbook)
  • Knowledge about adding/removing packages (check man pkg_info/man pkg_add/man pkg_delete).
  • Knowledge about Ports concept and its general usage (check http://freebsd.org/handbook/ports.html chapter from FreeBSD Handbook)

  • What You will learn:

  • Knowledge about keeping both FreeBSD's base system and package up-to-date.



  • Today, I would like to 'touch' an ungrateful topic of keeping both FreeBSD's base system and installed packages up-to-date.

    After I started using FreeBSD at 5.4 times (2005) I have tried various methods of keeping my FreeBSD installations up-to-date, many of them terribly failed, but some recent ones seem to do the job as advertised. Even not so recently ago I thought, lets stick to RELEASE and do not compile newer versions of packages as there are available packages at FTP ... but there is a big problem with such attitude. First, once the RELEASE is completed, there are only security fixes for the base system, but there are no bug fixes for the RELEASE. Its even worse with packages for RELEASE since once they are built they are never later updated, even if they have security issues, not even mentioning bugs. So that is definitely not the right way.

    The sollution seems to be tracking STABLE tree for the base system along with packages that are built every 2 weeks for the STABLE tree and compiling only when there are security issues in some of the installed packages, but there are for example 10 more days before their rebuilt versions would show up on the STABLE tree FTP. Below I would try to describe all that process of keeping FreeBSD up-to-date as simple as possible. In the first part I would focus on the base system and the second one will cover keeping packages up-to-date.

    Some important information about keeping Your system this way. You would not rebuild the base system every day, not even every week, just when needed. Now what does it mean 'when needed' ... For example when there is a security issue, You would just follow the instructions in the SA (security advisory) to fix that issue, there is no need to rebuild whole world. The only reasons to rebuild the base system are that there has been found and fixed a bug in STABLE that affects You or that You need new features that has been merged into the STABLE branch (from CURRENT for example) like newer ZFS version or whatever.

    As for the installation, You can install the RELEASE version and update to STABLE or install the daily STABLE snapshot so You would not have to build entire base system from source, the daily ISO images are available at http://pub.allbsd.org/FreeBSD-snapshots/ server.

    PART I. Keeping the FreeBSD base system up-to-date

    Some facts about FreeBSD's base system:

  • once RELEASE is completed, there are only security fixes, there are no bug fixes
  • bugs in STABLE tree are fixed
  • security issues are also fixed in STABLE
  • the RELEASE branch allows to use binary updates via freebsd-update tool for security fixes
  • the STABLE branch requires compiling of the FreeBSD base system
  • We need to clone the current cource tree if we want to build up to date STABLE branch FreeBSD's base system, we will also need to update our sources to the current state so its quite handy to find fastest server for Your location, it can be easily done by using sysutils/fastest_cvsup package as showed in listing I.1.

    # pkg_add -r fastest_cvsup
    # rehash
    # fastest_cvsup -c all
    (...)
    
    >>  Speed Daemons:
        - 1st: cvsup.pl.freebsd.org
        - 2nd: cvsup11.ua.freebsd.org
        - 3rd: cvsup5.de.freebsd.org
    Listing I.1 Searching for the fastest csup(1) server with fastest_cvsup(7) package


    For my location it is cvsup.pl.freebsd.org which in most cases will be different ther for Your location, so remember to put Your's fastest in the next steps.

    Create simple supfile that will be used by csup(1) to keep FreeBSD's base system sources up-to-date (listing I.2). There are useful examples under /usr/share/examples/cvsup/ if you want to 'dig more'.

    # cat > /root/stable-supfile << EOF
    *default host=cvsup.pl.freebsd.org
    *default base=/var/db
    *default prefix=/usr
    *default release=cvs tag=RELENG_9
    *default delete use-rel-suffix
    *default compress
    src-all
    EOF
    Listing I.2 Creating csup(1) config file that will update sources to 9-STABLE


    Now lets get/update our sources to the current state (listing I.3), the list of edited/checked files will be quite different on Your box since I already have quite up-to-date sources, this will take more time if You do not have the sources on the disk.

    # csup /root/stable-supfile
    Connected to 188.125.237.138
    Updating collection src-all/cvs
     Edit src/bin/ed/buf.c
     Edit src/sbin/fsck_ffs/main.c
     Edit src/sbin/mdconfig/mdconfig.8
     Edit src/sbin/mdconfig/mdconfig.c
     Edit src/share/man/man4/ath.4
     Edit src/share/man/man4/ath_hal.4
     Edit src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
     Edit src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
     Edit src/sys/dev/ahci/ahci.c
     Edit src/sys/fs/msdosfs/msdosfs_vnops.c
     Edit src/sys/fs/nfsclient/nfs_clbio.c
     Edit src/sys/fs/nfsserver/nfs_nfsdserv.c
     Edit src/sys/fs/nwfs/nwfs_io.c
     Edit src/sys/fs/smbfs/smbfs_io.c
     Edit src/sys/fs/tmpfs/tmpfs_vnops.c
     Edit src/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c
     Edit src/sys/kern/uipc_usrreq.c
     Edit src/sys/kern/vfs_vnops.c
     Edit src/sys/nfsclient/nfs_bio.c
     Edit src/sys/sparc64/sbus/sbus.c
     Edit src/sys/sys/vnode.h
     Edit src/sys/ufs/ffs/ffs_inode.c
     Edit src/sys/ufs/ffs/ffs_vnops.c
    Finished successfully
    Listing I.3 Updating FreeBSD source tree using csup(1) from the base system


    Alternatively, You can grab the sources by SVN protocol, but You will need devel/subversion16 package for that purpose. Its generally a lot faster/easier to 'setup' then csup but the 'csup way' has one important advantage, its in the FreeBSD's base system, so its always available, anywhere. With SVN, You will have to add a package first which sometimes may be cumbersome. But as the FreeBSD source tree is kept under SVN it is possible that SVN will be part of the FreeBSD's base system one day.

    It's also important to mention, that sources downloaded by SVN are not compatible with the sources grabbed by csup, so once You will decide which method to use, stick with it, unless You want to download the whole FreeBSD's source tree again. Below (listing I.4) we have SVN update to 9-STABLE latest state.

    # svn checkout svn://svn.freebsd.org/base/stable/9 /usr/src
    U    /usr/src/usr.bin/grep/util.c
     U   /usr/src/usr.bin/grep
    U    /usr/src/share/man/man5/rc.conf.5
     U   /usr/src/share/man/man5
    U    /usr/src/share/man/man9/driver.9
     U   /usr/src/share/man/man9
    U    /usr/src/usr.sbin/mergemaster/mergemaster.sh
     U   /usr/src/usr.sbin/mergemaster
     U   /usr/src/lib/libc/stdtime
     U   /usr/src/lib/libc
    U    /usr/src/lib/librt/timer.c
     U   /usr/src/lib/librt
    U    /usr/src/lib/libpam/modules/pam_ssh/pam_ssh.c
     U   /usr/src/lib/libpam
    U    /usr/src/etc/network.subr
    U    /usr/src/etc/devd.conf
     U   /usr/src/etc
    U    /usr/src/sys/sparc64/pci/schizo.c
    U    /usr/src/sys/kern/kern_ctf.c
    U    /usr/src/sys/kern/vfs_syscalls.c
    U    /usr/src/sys/kern/sys_generic.c
    U    /usr/src/sys/netinet/tcp_reass.c
    U    /usr/src/sys/netinet6/nd6.c
    U    /usr/src/sys/contrib/pf/net/pf.c
     U   /usr/src/sys/contrib/pf
    U    /usr/src/sys/amd64/include/segments.h
     U   /usr/src/sys/amd64/include/xen
    U    /usr/src/sys/amd64/include/trap.h
    U    /usr/src/sys/amd64/amd64/trap.c
    U    /usr/src/sys/sys/bus.h
     U   /usr/src/sys
    Checked out revision 228452.
    Listing I.4 Updating FreeBSD source tree using svn(1) from the devel/subversion16 package


    It's the same no matter if You download the whole tree or just doing an update from yesterday. If svn will complain about anything, just delete the /usr/src and type the command again.

    Now as we have the sources we can continue to building the FreeBSD's base system from source (listing I.5). As for editing the kernel config, You do not even have to bother about it, just use GENERIC, this guide is not about stripping the base system and kernel components, its about keeping everything up-to-date. Of course if You want to, then use Your tweaked kernel config, it will not interfere with the rest of this guide. You may want to put nice -n 20 in front of make buildworld ... line to make that build process less 'amusing' for your system. As instructions are completed, Your system will reboot.

    # cd /usr/src
    # rm -r -f /usr/obj
    # make buildworld kernel KODIR=/boot/testing
    # nextboot -k testing
    # shutdown -r now
    Listing I.5 Building FreeBSD's base system


    We are now proceeding to the second phase of the upgrade process (listing I.6). After normal boot (single-user mode not required and definitely prohibited while doing upgrade over the network) stop all unneeded services (remember to keep sshd daemon alive if you are doing upgrade via network). If your system booted up properly, then You can make the new testing kernel the default one, at least there should not be any problems with the GENERIC kernel config ;)

    # cd /boot
    # rm -r -f OLD
    # mv kernel OLD
    # mv testing kernel
    # killall dhclient moused
    # /etc/rc.d/cron stop
    # /etc/rc.d/devd stop
    # /etc/rc.d/sshd stop
    # /etc/rc.d/powerd stop
    # /etc/rc.d/syslogd stop
    Listing I.6 Making new kernel permanent and stopping unneded services


    The list of started processes (listing I.7) will look something like that including (or not) sshd(8) for keeping up the network connection.

    # top -b
    last pid: 64835;  load averages:  0.00,  0.00,  0.00  up 0+03:11:51    10:24:37
    119 processes: 2 running, 117 sleeping
    
    Mem: 960M Active, 355M Inact, 4014M Wired, 6096K Cache, 8368K Buf, 2527M Free
    Swap:
    
      PID USERNAME      THR PRI NICE   SIZE    RES STATE   C   TIME   WCPU COMMAND
     2178 root            1  54    0 10304K  2748K ppwait  0   0:00  0.00% csh
     2174 root            1  45    0 21696K  1992K wait    0   0:00  0.00% login
     2177 root            1  76    0  6912K  1284K ttyin   0   0:00  0.00% getty
     2176 root            1  76    0  6912K  1284K ttyin   1   0:00  0.00% getty
     2175 root            1  76    0  6912K  1284K ttyin   0   0:00  0.00% getty
      114 root            1  76    0  2764K  1056K pause   0   0:00  0.00% adjkerntz
    Listing I.7 Cut to minimum list of running processes during the upgrade process


    Now we can continue to type rest of needed instructions (listing I.8) to finish the update, the mergemaster(8) will ask You for the differences in startup scripts that You have modified and configuration files, type 'I' to install the new/default config and/or script and select 'D' to leave the version that you have in the system, remember that You can also add these changes later, it may be not appreciate to install default firewall config or customized OpenSSH config while doing the network upgrade.

    # cd /usr/src
    # mergemaster -p
    # make installworld
    # mergemaster -iU
    # make delete-old
    # shutdown -r now
    Listing I.8 Installing the newly built base system


    After that second reboot You should have updates to STABLE branch FreeBSD's base system, I wrote 'should' because sometimes things do not go the way we want them to go, especially if you are doing it the first time as once Aerosmith sing "I know it's everybody's sin, You got to lose to know how to win". It would be best to do these instructions as exercise under virtual machine like VirtualBox or QEMU.

    Also, if you do not feel that STABLE is 'production enought', then You may want to use STABLE packages along with RELEASE base system, You will need to define environment variable PACKAGESITE that will point to http://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/Latest/ at least for FreeBSD 9.x system.

    PART II. Keeping the FreeBSD packages up-to-date

    Keeping packages up to date is little more tricky, we will also need the STABLE branch for them as these in RELEASE are not updated. Lets assume that You installed the FreeBSD STABLE snapshot a month ago, along with packages that were built by then, now there will be quite a lot of new versions for many packages which is not that important, but some of them can (and probably have) security issues and definitely should be updated. You can of course compile them from Ports using portmaster(8) but why waste time for compiling, when You can use built every 2 weeks packages from the STABLE branch? The pkg_upgrade(1) script from the sysutils/bsdadminscripts package will be quite helpful here. It will fetch latest available packages from the STABLE FTP and there is a chance that the security issues will be solved by the newer versions, if not, we are forced to rebuild those packages from source using portmaster(8), but its a lot better and faster to recompile 1-2 packages instead of 30 or more.

    As for updating the packages, I generally check them daily, mostly for security issues that would be reported with portaudit(1) (from ports-mgmt/portaudit package), there are often new versions reported, sometimes even quite lot, but as long as there are 0 problem(s) in your installed packages found. I do not bother. From time to time I fire up pkg_upgrade -a -C to fetch the latest packages from the STABLE branch FTP.

    Some of You would certainly ask why use pkg_upgrade(1) instead of updating with portmaster(8)? Well, for example You have package z-1.0 installed in Your system, latest package available on the FTP is z-1.1z-1.2, so portmaster(8) will omit that z-1.1 package no matter if its newer or not and will force You to compile the z-1.2 package from the Ports system.

    Keeping FreeBSD packages up-to-date in short:

  • use packages from STABLE that are built every 2 weeks
  • use pkg_upgrade(1) to update packages
  • use portmaster(8) to rebuild packages that have security issues
  • Some facts about being up-to-date with FreeBSD's packages:

  • with every RELEASE, packages are built and then they are never updated (even if they have security issues)
  • for the STABLE tree packages are rebuilt every 2 weeks
  • First, we need to install tools that we will use to keep FreeBSD packages up-to-date.

    # pkg_add -r bsdadminscripts portmaster portaudit

    Optionally, we can allow users in group wheel to perform these task using sudo(8)sysutils/sudo package with pkg_add -r sudo command first) as they are already allowed to login on the root account, we can of course create separate group like maintainers that will be allowed to perform upgrades. You will need this line below in /usr/local/etc/sudoers file.

    %wheel ALL=NOPASSWD: /usr/sbin/portsnap, /usr/local/sbin/pkg_upgrade, /usr/local/sbin/portmaster, /usr/local/sbin/portaudit

    Here is the most important part, the commands put together into functions that will allow us easy checking for newer versions of the packages, security issues and updating them to newer/fixed versions. The ports-check function fetches latest Ports tree, then shows what new packages are available comparing to those installed on the system, next the security issues are checked with portaudit(8) and last, the /usr/ports/UPDATING file is checked for various messages that can affect us. The ports-check (listing II.1) does not rebuild or update any packages, as the name says, only checks.

    function ports-check {
      # FETCH LATEST PORTS TREE
      sudo portsnap fetch update
    
      # CHECK WHAT NEW VERSIONS EXIST
      sudo portmaster -L --index-only | awk '/ [Nn]ew / {print substr($0,9,9999)}'
    
      # CHECK SECURITY ISSUES
      sudo portaudit -Fda
    
      # CHECK /usr/ports/UPDATING MESSAGES
      pkg_updating -d $( ls -ltr -D '%Y%m%d' /var/db/pkg | awk 'END{print $6}' )
    }
    Listing II.1 The ports-check function


    The second function, ports-update is for updating the packages (listing II.2) using the STABLE branch, it uses pkg_upgrade(1) from sysutils/bsdadminscripts package, but it will not compile from Ports. You can use it in two ways, without arguments it will update all packages that will be found on the STABLE FTP, but as showed in exampleII.5 it can be also used only to rebuild several packages that You need to update. It is also possible to specify several packages to be updated, not only one, like that ports-update openbox nautilus xterm for example.

    function ports-update {
      # UPDATE ALL PACKAGES OR ONLY A SINGLE ONE USING STABLE PATH ON FTP
      case ${#} in
        (0) sudo pkg_upgrade -C -a 2>&1 | grep --color=none --line-buffered -E "^(=+>|/usr/ports|/var/db)" ;;
        (*) sudo pkg_upgrade -C $@ 2>&1 | grep --color=none --line-buffered -E "^(=+>|/usr/ports|/var/db)" ;;
      esac
    
      # FIX DEPENDENCIES AS NEEDED
      sudo portmaster --check-depends
    }
    Listing II.2 The ports-update function


    The last one (listing II.3) named ports-build rebuilds the specified package or all of them if You do not specify one, used mostly to rebuild packages with security issues. This one also can be used without arguments to rebuild all Ports packages or with argument(s) to rebuild only packages that You need to rebuild.

    function ports-build {
      # REBUILD SINGLE, SEVERAL OR ALL PORTS
      case ${#} in
        (0) sudo portmaster -y --no-confirm -m 'BATCH=yes' -d -a ;;
        (*) sudo portmaster -y --no-confirm -m 'BATCH=yes' -d $@ ;;
      esac
    
      # FIX DEPENDENCIES AS NEEDED
      sudo portmaster --check-depends
    }
    Listing II.3 The ports-build function


    ... and thats it generally, I would show some example of these functions usage below.

    You will have to put these functions into Your shells startup files, it will be /etc/profile for sh(1) shell and also for bash(1), /etc/zshrc for zsh(1) shell. It will not work for C-shells like csh(1) since they do not support functions and are retarded in many other ways: http://www.grymoire.com/Unix/CshTop10.txt

    Drawbacks

    Using this way of keeping the installed packages up-to-date You have to remember two things.

    Customized packages. If You built some package with non-default options by compiling it, after upgrade it will 'revert' do the default options and You will have to build it again.

    Kernel modules. Any package that comes with kernel modules can and probably will break at some point because the STABLE source tree is a 'moving target', that is one of the good reasons to update the base system and then update to latest packages. The packages that have kernel modules are for example emulators/virtualbox-ose (VirtualBox), sysutils/fusefs-kmod (FUSE implementation) and most notably x11/nvidia-driver (binary nVidia graphics driver).

    [code]% ports-check
    Looking up portsnap.FreeBSD.org mirrors... 5 mirrors found.
    Fetching snapshot tag from portsnap5.freebsd.org... done.
    Fetching snapshot metadata... done.
    Updating from Mon Sep  5 07:11:28 CEST 2011 to Mon Sep  5 08:51:01 CEST 2011.
    Fetching 3 metadata patches.. done.
    Applying metadata patches... done.
    Fetching 0 metadata files... done.
    Fetching 10 patches.....10 done.
    Applying patches... done.
    Fetching 1 new ports or files... done.
    Removing old files and directories... done.
    Extracting new files:
    /usr/ports/chinese/c2t/
    /usr/ports/chinese/hc/
    /usr/ports/devel/Makefile
    /usr/ports/devel/p5-System-Command/
    /usr/ports/german/mythes/
    /usr/ports/math/p5-Statistics-R/
    /usr/ports/polish/hunspell/
    /usr/ports/textproc/es-mythes/
    /usr/ports/textproc/nl-mythes/
    /usr/ports/textproc/sk-mythes/
    /usr/ports/textproc/sl-mythes/
    Building new INDEX files... done.
    New version available: arc-5.21p
    New version available: ca_root_nss-3.12.11_1
    New version available: expat-2.0.1_2
    New version available: tinyxml-2.6.2
    New version available: bash-4.1.11
    New version available: gstreamer-plugins-0.10.35_1,3
    New version available: gtk-2.24.6
    New version available: gtk-update-icon-cache-2.24.6
    New version available: libsamplerate-0.1.8_1
    New version available: nas-1.9.3
    New version available: nettle-2.4
    New version available: p5-Date-Manip-6.25
    New version available: p5-Mail-IMAPClient-3.29
    New version available: p5-XML-Parser-2.41
    New version available: xterm-273
    New version available: filezilla-3.5.1
    New version available: firefox-6.0.1,1
    New version available: gtk-oxygen-engine-1.1.2
    New version available: nginx-1.0.6,1
    New version available: qemu-0.11.1_10
    20 have new versions available
    New database installed.
    Database created: Thu Sep  1 21:20:00 CEST 2011
    0 problem(s) in your installed packages found.
    Example II.1 Typical output about new/updated ports and new versions available


    % ports-check
    Looking up portsnap.FreeBSD.org mirrors... 5 mirrors found.
    Fetching snapshot tag from portsnap1.freebsd.org... done.
    Fetching snapshot metadata... done.
    Updating from Mon Sep  5 10:28:51 CEST 2011 to Mon Sep  5 12:07:23 CEST 2011.
    Fetching 3 metadata patches.. done.
    Applying metadata patches... done.
    Fetching 0 metadata files... done.
    Fetching 20 patches.....10....20 done.
    Applying patches... done.
    Fetching 1 new ports or files... done.
    Removing old files and directories... done.
    Extracting new files:
    /usr/ports/MOVED
    /usr/ports/Mk/bsd.sites.mk
    /usr/ports/cad/Makefile
    /usr/ports/devel/Makefile
    /usr/ports/devel/p5-Bread-Board-Declare/
    /usr/ports/devel/p5-Curses-UI/
    /usr/ports/devel/p5-Data-Peek/
    /usr/ports/devel/p5-Scope-Upper/
    /usr/ports/dns/pear-Net_DNS2/
    /usr/ports/lang/p5-Try-Tiny/
    /usr/ports/mail/p5-Email-Valid/
    /usr/ports/math/p5-Math-BigInt/
    /usr/ports/math/p5-Statistics-Descriptive/
    /usr/ports/net/pear-Net_SMTP/
    /usr/ports/ports-mgmt/portaudit-db/
    /usr/ports/sysutils/py-supervisor/
    /usr/ports/sysutils/zfsnap/
    /usr/ports/www/nginx-devel/
    /usr/ports/www/nginx/
    /usr/ports/www/rubygem-passenger/
    /usr/ports/x11/Makefile
    Building new INDEX files... done.
    New version available: arc-5.21p
    New version available: ca_root_nss-3.12.11_1
    New version available: expat-2.0.1_2
    New version available: tinyxml-2.6.2
    New version available: bash-4.1.11
    New version available: gstreamer-plugins-0.10.35_1,3
    New version available: gtk-2.24.6
    New version available: gtk-update-icon-cache-2.24.6
    New version available: libsamplerate-0.1.8_1
    New version available: nas-1.9.3
    New version available: nettle-2.4
    New version available: p5-Date-Manip-6.25
    New version available: p5-Mail-IMAPClient-3.29
    New version available: p5-XML-Parser-2.41
    New version available: xterm-273
    New version available: filezilla-3.5.1
    New version available: firefox-6.0.1,1
    New version available: gtk-oxygen-engine-1.1.2
    New version available: nginx-1.0.6,1
    New version available: qemu-0.11.1_10
    20 have new versions available
    auditfile.tbz                                 100% of   69 kB   54 kBps
    New database installed.
    Database created: Mon Sep  5 12:35:01 CEST 2011
    Affected package: ca_root_nss-3.12.9
    Type of problem: ca_root_nss -- Extraction of unsafe certificates into trust bundle..
    Reference: http://portaudit.FreeBSD.org/1b27af46-d6f6-11e0-89a6-080027ef73ec.html
    
    Affected package: ca_root_nss-3.12.9
    Type of problem: nss/ca_root_nss -- Fraudulent Certificates issued by DigiNotar.nl.
    Reference: http://portaudit.FreeBSD.org/aa5bc971-d635-11e0-b3cf-080027ef73ec.html
    
    2 problem(s) in your installed packages found.
    
    You are advised to update or deinstall the affected package(s) immediately.
    Example II.2 A report that also shows some security issues


    % ports-build ca_root_nss
    
    ===>>> Currently installed version: ca_root_nss-3.12.9
    ===>>> Port directory: /usr/ports/security/ca_root_nss
    
    (...)
    
    ===>>> Updating dependency entry for ca_root_nss-3.12.11_1 in each dependent port
    ===>>> Upgrade of ca_root_nss-3.12.9 to ca_root_nss-3.12.11_1 complete
    
    % ports-check
    Looking up portsnap.FreeBSD.org mirrors... 5 mirrors found.
    Fetching snapshot tag from portsnap2.freebsd.org... done.
    Fetching snapshot metadata... done.
    Updating from Mon Sep  5 12:07:23 CEST 2011 to Mon Sep  5 12:25:09 CEST 2011.
    Fetching 3 metadata patches.. done.
    Applying metadata patches... done.
    Fetching 0 metadata files... done.
    Fetching 2 patches.. done.
    Applying patches... done.
    Fetching 0 new ports or files... done.
    Removing old files and directories... done.
    Extracting new files:
    /usr/ports/devel/p5-File-NFSLock/
    /usr/ports/devel/p5-MooseX-Aliases/
    Building new INDEX files... done.
    New version available: arc-5.21p
    New version available: expat-2.0.1_2
    New version available: tinyxml-2.6.2
    New version available: bash-4.1.11
    New version available: gstreamer-plugins-0.10.35_1,3
    New version available: gtk-2.24.6
    New version available: gtk-update-icon-cache-2.24.6
    New version available: libsamplerate-0.1.8_1
    New version available: nas-1.9.3
    New version available: nettle-2.4
    New version available: p5-Date-Manip-6.25
    New version available: p5-Mail-IMAPClient-3.29
    New version available: p5-XML-Parser-2.41
    New version available: xterm-273
    New version available: filezilla-3.5.1
    New version available: firefox-6.0.1,1
    New version available: gtk-oxygen-engine-1.1.2
    New version available: nginx-1.0.6,1
    New version available: qemu-0.11.1_10
    19 have new versions available
    auditfile.tbz                                 100% of   69 kB   54 kBps
    New database installed.
    Database created: Mon Sep  5 12:40:01 CEST 2011
    0 problem(s) in your installed packages found.
    Example II.3 Solving the security issues by rebuilding the problematic package


    % ports-update
    /var/db/uma/FTPINDEX                          100% of   21 MB 1139 kBps 00m00s
    /usr/ports/packages/All/nettle-2.4.tbz        100% of 1082 kB  332 kBps
    /usr/ports/packages/All/gtk-2.24.6.tbz        100% of 9822 kB  253 kBps 00m00s
    /usr/ports/packages/All/gstreamer-plugins-0.10100% of 4091 kB  942 kBps
    /usr/ports/packages/All/gtk-oxygen-engine-1.1.100% of  509 kB  339 kBps
    /usr/ports/packages/All/filezilla-3.5.1.tbz   100% of 3301 kB  232 kBps 00m00s
    /usr/ports/packages/All/nas-1.9.3.tbz         100% of  487 kB  494 kBps
    /usr/ports/packages/All/expat-2.0.1_2.tbz     100% of  130 kB  129 kBps
    /usr/ports/packages/All/xterm-273.tbz         100% of  262 kB  104 kBps
    /usr/ports/packages/All/p5-XML-Parser-2.41.tbz100% of  184 kB  381 kBps
    /usr/ports/packages/All/nginx-1.0.6,1.tbz     100% of  225 kB  206 kBps
    /usr/ports/packages/All/qemu-0.11.1_10.tbz    100% of   12 MB  359 kBps 00m00s
    /usr/ports/packages/All/tinyxml-2.6.2.tbz     100% of  170 kB  121 kBps
    /usr/ports/packages/All/p5-Date-Manip-6.25.tbz100% of 1301 kB  681 kBps
    ===> Update <tinyxml-2.6.1_1> to <tinyxml-2.6.2> (textproc/tinyxml)
    => Update <tinyxml-2.6.1_1> to <tinyxml-2.6.2> (textproc/tinyxml) succeeded
    ===> Update <p5-Mail-IMAPClient-3.28> to <p5-Mail-IMAPClient-3.29> (mail/p5-Mail-IMAPClient)
    => Update <p5-Mail-IMAPClient-3.28> to <p5-Mail-IMAPClient-3.29> (mail/p5-Mail-IMAPClient) succeeded
    ===> Update <p5-Date-Manip-6.24> to <p5-Date-Manip-6.25> (devel/p5-Date-Manip)
    => Update <p5-Date-Manip-6.24> to <p5-Date-Manip-6.25> (devel/p5-Date-Manip) succeeded
    ===> Update <nginx-1.0.5,1> to <nginx-1.0.6,1> (www/nginx)
    => Update <nginx-1.0.5,1> to <nginx-1.0.6,1> (www/nginx) succeeded
    ===> Update <nettle-2.2> to <nettle-2.4> (security/nettle)
    => Update <nas-1.9.2> to <nas-1.9.3> (audio/nas) succeeded
    ===> Update <libsamplerate-0.1.7_1> to <libsamplerate-0.1.8_1> (audio/libsamplerate)
    => Update <libsamplerate-0.1.7_1> to <libsamplerate-0.1.8_1> (audio/libsamplerate) succeeded
    ===> Update <expat-2.0.1_1> to <expat-2.0.1_2> (textproc/expat2)
    => Update <expat-2.0.1_1> to <expat-2.0.1_2> (textproc/expat2) succeeded
    ===> Update <xterm-271> to <xterm-273> (x11/xterm)
    => Update <xterm-271> to <xterm-273> (x11/xterm) succeeded
    ===> Update <qemu-0.11.1_9> to <qemu-0.11.1_10> (emulators/qemu)
    => Update <qemu-0.11.1_9> to <qemu-0.11.1_10> (emulators/qemu) succeeded
    ===> Update <p5-XML-Parser-2.40> to <p5-XML-Parser-2.41> (textproc/p5-XML-Parser)
    => Update <p5-XML-Parser-2.40> to <p5-XML-Parser-2.41> (textproc/p5-XML-Parser) succeeded
    ===> Update <gtk-update-icon-cache-2.24.5> to <gtk-update-icon-cache-2.24.6> (graphics/gtk-update-icon-cache)
    => Update <gtk-update-icon-cache-2.24.5> to <gtk-update-icon-cache-2.24.6> (graphics/gtk-update-icon-cache) succeeded
    ===> Update <gtk-2.24.5_1> to <gtk-2.24.6> (x11-toolkits/gtk20)
    => Update <gtk-2.24.5_1> to <gtk-2.24.6> (x11-toolkits/gtk20) succeeded
    ===> Update <gtk-oxygen-engine-1.1.1> to <gtk-oxygen-engine-1.1.2> (x11-themes/gtk-oxygen-engine)
    => Update <gtk-oxygen-engine-1.1.1> to <gtk-oxygen-engine-1.1.2> (x11-themes/gtk-oxygen-engine) succeeded
    ===> Update <gstreamer-plugins-0.10.35,3> to <gstreamer-plugins-0.10.35_1,3> (multimedia/gstreamer-plugins)
    => Update <gstreamer-plugins-0.10.35,3> to <gstreamer-plugins-0.10.35_1,3> (multimedia/gstreamer-plugins) succeeded
    ===> Update <firefox-6.0_1,1> to <firefox-6.0.1,1> (www/firefox)
    => Update <firefox-6.0_1,1> to <firefox-6.0.1,1> (www/firefox) succeeded
    ===> Update <filezilla-3.5.0_1> to <filezilla-3.5.1> (ftp/filezilla)
    => Update <filezilla-3.5.0_1> to <filezilla-3.5.1> (ftp/filezilla) succeeded
    ===> Update <bash-4.1.10> to <bash-4.1.11> (shells/bash)
    => Update <bash-4.1.10> to <bash-4.1.11> (shells/bash) succeeded
    ===> Update <arc-5.21o_1> to <arc-5.21p> (archivers/arc)
    => Update <arc-5.21o_1> to <arc-5.21p> (archivers/arc) succeeded
    ===>>> Checking 2bsd-vi-050325_1
    ===>>> Checking ImageMagick-6.7.1.10
    ===>>> Checking ORBit2-2.14.19
    ===>>> Checking OpenEXR-1.6.1_3
    ===>>> Checking Thunar-1.2.2_2
    (...)
    Example II.4 Updating the installed packages using STABLE branch


    % ports-update openbox
    ===> Update <openbox-3.5.0> to <openbox-3.5.0> (x11-wm/openbox)
    => Update <openbox-3.5.0> to <openbox-3.5.0> (x11-wm/openbox) succeeded
    
    (...)
    
    ===>>> Checking nss-3.12.11
    ===>>> Checking open-motif-2.3.3
    ===>>> Checking openbox-3.5.0
            ===>>> No installed ports depend on openbox-3.5.0
            ===>>> Emptying +REQUIRED_BY file.  Try portmaster -s
    Example II.5 Updating only a single package


    That's all folks! ;)