Superceded
packagesbootstrap has now been superceded bypkg_add -uin with an appropriately set PKG_CACHE. This page is left for information only.
Overview
See screenshots of packagesbootstrap in action!
packagesbootstrap is a small utility which bulk downloads OpenBSD binary packages. The downloaded packages can then be installed en masse, minimising downtime. packagesbootstrap has a number of useful features:
- Requires only utilities found in base install of OpenBSD - can be run on a freshly installed machine.
- Can interpret the output of
pkg_infodirectly. If a list of packages is not specified, the output frompkg_infoon the machine packagesbootstrap is being run on is used automatically. - Downloads the latest version of a package.
- Understands package flavours.
- Asks the user what to do in the presence of multiple versions of the same package.
- Warns the user at the end of the download which packages could not be downloaded.
- Can download packages for
-currentor-stable. packagesbootstrap detects which version the user is running, but this can be overridden.
Running packagesbootstrap
When you run packagesbootstrap, it goes to the specified FTP server and downloads the list of packages stored there. It then looks at the list of packages you wish to download, and attempts to find an appropriate match for each one on the FTP server. When multiple versions of the package exist (e.g. typicallyautoconf has several versions for download), packagesbootstrap will interactively ask you which version you wish to download. You may download more than one version.
Once matches have been found for packages, packagesbootstrap then downloads each package, one by one. Once it has downloaded all packages, it warns you of any packages you requested for which it was unable to find a match. Typically such packages are ones with restrictive licenses, which you will have to build manually from the ports system.
You can get a good idea of how packagesbootstrap works by looking at the screenshots of it in action.
Command-line options
packagesbootstrap can be called as follows:packagesbootstrap [<options>] [<packages list>]
<packages list> is either a list of package names, separated by newlines, or the output from the pkg_info command. If <packages list> is not specified, the list of packages installed on current machine will be used.
Other options are as follows:
-f <ftp server>
Default:ftp://ftp.openbsd.org/pub/OpenBSD/
FTP server to download binary packages from. Please be considerate, and use a local mirror.-o <version>
Default: Depends on OS installed
OS version number. e.g.3.7orsnapshot-a <arch>
Default: The current machine architecture
Architecture to download packages for. e.g.i386orsparc-d <dir>
Default:/usr/ports/packages/arch/all
Directory to save packages to.-l
Default: Off
Do not prompt if multiple matches found. Automatically downloads all matches. This option makes packagesbootstrap completely non-interactive.
packagesbootstrap in use
There are various potential ways that packagesbootstrap could be used. I typically use it either to get a freshly installed machine into shape, to minimise downtime when updating a server, or just as a quick way to update a desktop machine to the latest snapshot. Such uses tend to look as follows:packagesbootstrap -f ftp://ftp.plig.org/pub/OpenBSD/ -d packages pkg_info | cut -d " " -f 1 | xargs sudo pkg_delete cd packages sudo pkg_add *This downloads new packages for everything that is installed on my machine, then deletes all the currently installed packages. Finally all the downloaded packages are then installed. There are various other ways that one can imagine the utility being used.