upgrading ports with portupgrade
There is a good reason to upgrade the installed ports on the system soon after installation in order to maintain a secure, up-to-date and powerful PC-BSD system. My favorite tool for updating ports is the method supported by portsnap and portupgrade. Portupgrade has the power to upgrade individual port files but does not install upgraded versions of the libraries and packages that those ports depend on. This can create a problem later on but there is a very agreeable fix.
If you have not done so already, start your upgrade process by downloading and extracting a current snapshot of the FreeBSD ports tree by using
portsnap fetch extract
portsnap fetch upgrade (if you have already used portsnap on a previous occasion)
This will download a fresh copy of the ports tree. If you already have the ports installed, portsnap will replace your old ports tree with this new snapshot. portsnap is included by default in the PC-BSD install.
after downloading the new shapshot, it is now time to determine how many, if any, of your ports need to be upgraded. Use the tool, portaudit to reveal this information.
(portaudit is included in the ports tree under /usr/ports/ports-mgmt/portaudit) Use make install clean to get it installed. Then you can use:
to determine how many of your installed ports could be upgraded and what each port depends on. You can audit individual ports just as easily by usin portaudit [options] pkgname. It is likely that portaudit will reveal some stale dependencies within your list of installed ports. Stale dependencies are program and libraries that are needed by the new, upgraded versions of the ports. If a dependency does not get upgraded with port that needs it, it is called "stale." If this happens, use
to fix all of the dependency issues caused by using the new ports tree to upgrade. Once pkgdb clears all dependency issues, you are now ready to use portupgrade for the upgrade of some or all of your ports. Portugrade comes with a number of very helpful options. To upgrade a single, specific port, use
portupgrade [options] pkgname
If you wish to upgrade all ports on the system use:
which will upgrade all ports while confirming the configuration settings for each port as it is being upgraded. This does take a while, but it grants a great deal of control over the update process and if you are upgrading only a few ports, this could be a great choice.
again to make sure there are no stale dependencies or problems after the upgrade. Once all stale dependencies have been fixed, you have successfully completed the process of upgrading your ports.