FreeBSD Installing Portsnap
FreeBSD Installing Portsnap
FreeBSD Installing Portsnap
Next
A.6.2 Installation
On FreeBSD 6.0 and more recent versions, Portsnap is contained in the FreeBSD base system. On older versions of FreeBSD, it can be installed using the ports-mgmt/portsnap port.
is installed, but a sample configuration file is distributed; to copy it into place, run the following command:
# cd /usr/local/etc && cp portsnap.conf.sample portsnap.conf
Once the compressed snapshot has been downloaded, a live copy of the ports tree can be extracted into /usr/ports/. This is necessary even if a ports tree has already been created in that directory (e.g., by usingCVSup), since it establishes a baseline from which portsnap can determine which parts of the ports tree need to be updated later.
# portsnap extract
Note: In the default installation /usr/ports is not created. If you run FreeBSD 6.0-RELEASE, it should be created before portsnap is used. On more recent versions of FreeBSD orPortsnap, this operation will be done automatically at first use of the portsnap command.
Note: Some older versions of portsnap do not support this syntax; if it fails, try instead the following:
# portsnap fetch # portsnap update
Instead, a special portsnap cron command exists, which waits for a random duration up to 3600 seconds before fetching updates. In addition, it is strongly recommended that portsnap update not be run from a cron job, since it is liable to cause major problems if it happens to run at the same time as a port is being built or installed. However, it is safe to update the ports' INDEX files, and this can be done by passing the -I flag to portsnap. (Obviously, if portsnap -I update is run from cron, then it will be necessary to run portsnap update without the -I flag at a later time in order to update the rest of the tree.) Adding the following line to /etc/crontab will cause portsnap to update its compressed snapshot and the INDEX files in /usr/ports/, and will send an email if any installed ports are out of date:
0 3 * * * root portsnap -I cron update && pkg_version -vIL=
Note: If the system clock is not set to the local time zone, please replace 3 with a random value between 0 and 23, in order to spread the load on the Portsnap servers more evenly. Note: Some older versions of portsnap do not support listing multiple commands (e.g., cron update) in the same invocation of portsnap. If the line above fails, try replacingportsnap -I cron update with portsnap cron && portsnap -I update.
Home Up
This, and other documents, can be downloaded from ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/. For questions about FreeBSD, read the documentation before contacting <questions@FreeBSD.org>. For questions about this documentation, e-mail <doc@FreeBSD.org>.