Installing and updating the ports on FreeBSD

Since I have a bare  FreeBSD  8.1 installation, I needed to install a couple of things like the Apache Web server. As wonderfully explained on the official FreeBSD documentation, there are three methods to accomplish this:
  • CVSup method
  • Portsnap method, and
  • Sysinstall method
I have a firewall which blocks my access to TCP port 5999 which is needed for the CVSup method therefore my preferred method is using  portsnap . One could install the ports using sysinstall but they might be outdated already which would need updating anyway.
Using  portnap  is very simple:
portsnap fetch
portsnap extract
portsnap update
Now you should have an up to date collection of ports ready to use. Make sure that you run the above commands with elevated privileges (using ' sudo ' command) or as root.
After updating the ports collection you might check which ones of your already installed ports needs updating by running:
pkg_version -vl '<'
The system will list all the ports that needs upgrading along with their actual versions.
In order to upgrade all the ports in one go you need one of these three utilities:
  • Portupgrade
  • Portmanager
  • Portmaster
The choice to go with either one of them depends on personal choice but the overall recommendation these days seems to be  portmanager  for speed, being failsafe and not depending on additional database or dependencies.
Before updating the system it will be a good idea to update the vulnerability database and check the system against it by running:
/usr/local/sbin/portaudit -Fda
相關文章
相關標籤/搜索