Updating OpenBSD packages with pkg_add

One nifty feature that recently made it’s way into OpenBSD is the ability to remotely update packages with the pkg_add utility. This is accomplished by adding the URL of a remote repository to the PKG_PATH variable, and then running pkg_add with the “-u” (update packages) and optional “-v” (verbose output) and “-i” (interactice installation) options:

$ export PKG_PATH=”ftp://ftp.openbsd.org/pub/OpenBSD/3.9/packages/i386/”

$ pkg_add -uvi

Candidates for updating curl-7.15.3 -> curl-7.15.1 curl-7.15.3                                          
Ambiguous: curl-7.15.3 could be curl-7.15.1 curl-7.15.3
Choose one package
         0: 
         1: curl-7.15.1
         2: curl-7.15.3
Your choice: 2
Looking for updates: complete                                                                           
Running the equivalent of pkg_add -r curl-7.15.3
parsing curl-7.15.3
Already installed: curl-7.15.3

This is a super useful feature for busy admins, and will definitely make my life easier!

Leave a Reply

Your email address will not be published. Required fields are marked *