>Using Portsnap

>For as long as I can remember I have been using cvsup to update my ports tree, but until recently I came across a quick excerpt on Richard Bejtlich blog about portsnap. I tried it once then stopped using cvsup for ports. Now I only use cvsup for sources and docs.

$> portsnap fetch
Fetching snapshot tag… done.
Fetching snapshot metadata… done.
Updating from Fri Jul 22 00:57:39 UTC 2005 to Fri Jul 22 02:22:01 UTC 2005.
Fetching 4 metadata patches… done.
Applying metadata patches… done.
Fetching 0 metadata files… done.
Fetching 4 patches… done.

Fetching 0 new ports or files… done.

$> portsnap extract
Building new INDEX files… done.

$> portsnap update
Removing old files and directories… done.
Extracting new files:
Building new INDEX files… done.

The fetch command fetches and stores a compressed snapshot of the ports tree, which is usually around 35MB in size. The compressed snapshot is stored in /usr/local/portsnap for later extraction using the ‘extract’ command. The extract command does exactly what it says, it extracts the contents of the compressed tree into /usr/ports/. Since this was my first time using portsnap and converting from cvsup, it was required that I extracted the compressed snapshot before I could use the update command to update my ports. Update is pretty fast compared to cvsup.

Now I just needed to see which ports were out dated:

$> pkg_version -L =

glib <
gnomekeyring <
iwi-firmware ?
k3b <
libidn <
mozilla <

There were about 20 ports which needed to be upgraded. Before I issuded the portupgrade command I needed to check for any stale dependencies and make sure my ports had no broken parts.

$> pkgdb -F

—> Checking the package registry database
Stale origin: ‘sysutils/iwi-firmware’: perhaps moved or obsoleted.
[Updating the portsdb in /usr/ports … – 13244 port entries found ………1000………2000………3000………4000………5000………6000
………13000.. ….. done]
Skip this for now? [yes] yes

The -F option lets you interactively fix the registry database if there appears to be a problem with a particular port. When I ran pkgdb one file was detected to have a stale origin, but I know this is no error as I have manually installed iwi-firmware to enable my ThinkPad wireless BG card to work correctly. iwi-firmware as of FreeBSD 5.4-Release was not included within the ports tree, but I assume that will change soon. I can now safely upgrade my the installed packages which need updating with portupgrade.

When I use portupgrade I like to first fetch all the required packages before compiling. I do a recursive fetch for all the ports which will be needed for the compile:

$> portupgrade -arF
$> portupgrade -ar

The -F option causes portupgrade to just fetch packages and store them in /usr/ports/distfiles for later compilation. -a and -r are for all packages and recursive respectively.

This entry was posted in Uncategorized. Bookmark the permalink.

One Response to >Using Portsnap

  1. Anonymous says:

    >I was just browsing and found your blog. Very Nice!I have a free spyware remover site. It pretty much covers free spyware remover related stuff. Please visit, check it out and enjoy!Rod

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s