So, you install stuff from ports and then updates are released. How do you upgrade your software without having to uninstall and reinstall? This guide will show you how to use portupgrade.
- Local root access on the box or be able to su to root.
- A SSH client such as puTTy or SecureCRT (if you are setting it up remotely).
- Portsnap or cvsup-without-gui
- Ports! If you don’t have ports installed, you can install it with /stand/sysinstall
In order for us to use the upgrade utility, we need to install it first. So, logon to the machine as root or su to root.
# cd /usr/ports/sysutils/portupgrade # make install clean
# portsnap fetch update
Now that the ports tree is updated, let’s see which of our ports are outdated.
# pkg_version apache = cups-base < cvsup-without-gui = daemontools = lynx = m4 = mod_php4 < nano = p5-DBI < p5-Data-ShowTable = p5-Mysql-modules = p5-Net-Daemon = p5-PlRPC = perl < portupgrade = samba = ucspi-tcp = wget =
You can also limit the display to only outdated packages with:
# pkg_version -L = cups-base < mod_php4 < p5-DBI < perl <
As you can see, there are a few packages that need to be updated. The format of portupgrade is as follows:
# portupgrade -o /path/to/port port_name
We're going to upgrade cups-base. So, we will run
# portupgrade -o /usr/ports/print/cups-base cups-base
If you don't know where the port is located at, run:
# cd /usr/ports # whereis port_name
Once it does its thing, you're all updated. You can run that for each port, or if you are daring, you can upgrade every port with:
# portupgrade -ra