Update FreeBSD and Ports with portmaster

Recent talks on FreeBSD-Ports lists have been about whether portupgrade should be shown the door, portmaster seems to be the new way to go.

http://lists.freebsd.org/pipermail/freebsd-ports/2011-July/068887.html

I still quite like portupgrade for some reasons but I would rather play it safe and jump on to portmaster before portupgrade sinks. In an old post I gave an example shell script that would run and bunch of stuff to update FreeBSD, in that script I used portupgade, this is the revised script using portmaster.

First make sure you have the following installed

#!/bin/sh

LOG_FILE="/var/log/freebsd-update.log"

echo "Starting updates: `date`" | tee -a ${LOG_FILE}
echo "***"
echo "*** Checking for FreeBSD patches..."
echo "***"
/usr/sbin/freebsd-update fetch | tee -a ${LOG_FILE}
/usr/sbin/freebsd-update install | tee -a ${LOG_FILE}

echo "***"
echo "*** Updating ports tree..."
echo "***"
/usr/sbin/portsnap fetch update | tee -a ${LOG_FILE}

echo "***"
echo "*** Looking for ports to update..."
echo "***"
/usr/local/sbin/portmaster -a --no-confirm | tee -a ${LOG_FILE}

echo "***"
echo "*** Checking installed ports for known security problems..."
echo "***"
/usr/local/sbin/portaudit -Fva | tee -a ${LOG_FILE}
echo "Finished updates: `date`" | tee -a ${LOG_FILE}

You may also like...

  • . $(dirname $0)/../patches/patch_php.sh
    Whats this?

    • This is a call to an additional script which allows both PHP4 and PHP5 to be installed on the same server. It mods LOCALBASE and PREFIX vars for lang/php4 and lang/php5 as well as any related ports.

      it works quite well – on apache you can change the PHP version just by changing the extension to .php4 and .php5 respectively.

      PHP4 is pretty much dead now though, so I don’t know if this kind of this would be of interest to any body. It does work with PHP 5.2 and PHP 5.4 side by side, or indeed as many different PHP versions as you like.

      If any body is interested in this method I could do a quick write up about it. Let me know :)

  • . $(dirname $0)/../patches/patch_php.sh
    Whats this?

    • This is a call to an additional script which allows both PHP4 and PHP5 to be installed on the same server. It mods LOCALBASE and PREFIX vars for lang/php4 and lang/php5 as well as any related ports.

      it works quite well – on apache you can change the PHP version just by changing the extension to .php4 and .php5 respectively.

      PHP4 is pretty much dead now though, so I don’t know if this kind of this would be of interest to any body. It does work with PHP 5.2 and PHP 5.4 side by side, or indeed as many different PHP versions as you like.

      If any body is interested in this method I could do a quick write up about it. Let me know :)