bpkg – package manager


bpkg --help
bpkg --version
bpkg help [command | topic]
bpkg [common-options] command [command-options] command-args


The build2 package manager is used to manipulate configurations, packages, and repositories using a set of commands that are summarized below.

For a detailed description of any command or help topic, use the help command or see the corresponding man page (the man pages have the bpkg- prefix, for example bpkg-help(1)). Note also that command-options and command-args can be specified in any order and common-options can be specified as part of command-options.

A bpkg configuration is a directory that will contain packages built with similar settings. For example, a configuration can be for a specific target (i686, x86_64), compiler (clang, gcc) compile options (-O3, -g), and so on. Configurations are relatively cheap and can be created and thrown away as needed. Configurations can be moved and copied by simply moving and copying the directories. Note, however, that a move or copy may render some packages out-of-date. In the build2 build system terms a bpkg configuration is an amalgamation that contains packages as subprojects.

A bpkg package is an archive or directory that contains a build2 project plus a package manifest file. bpkg can either use package archives/directories directly from the filesystem or it can fetch archives from repositories.

A bpkg repository is a collection of packages as well as prerequisite and complement repositories. A repository is identified by its location, which can be a local filesystem path or a remote HTTP or HTTPS URL.

A typical bpkg workflow would consist of the following steps.

Create Configuration
bpkg create cc config.cxx=clang++ \
  config.install.root=/usr/local config.install.sudo=sudo
Add Source Repositories
bpkg add

Repeat this command to add more repositories.

Fetch Available Packages List
bpkg fetch
Fetch and Build Packages
bpkg build libfoo bar
Drop Package
If some packages are no longer needed, we can remove them from the configuration.
bpkg drop libfoo
Refresh Available Packages List
bpkg fetch
Upgrade Packages
bpkg build bar
Install Packages
bpkg install bar


help [topic]
bpkg-help(1) – show help for a command or help topic
bpkg-cfg-create(1) – create configuration
bpkg-rep-info(1) – print repository information
bpkg-rep-add(1) – add repository to configuration
bpkg-rep-fetch(1) – fetch list of available packages
rep-create [dir]
bpkg-rep-create(1) – create repository
bpkg-pkg-status(1) – print package status
bpkg-pkg-build(1) – build package
bpkg-pkg-drop(1) – drop package
bpkg-pkg-install(1) – install package
bpkg-pkg-uninstall(1) – uninstall package
bpkg-pkg-update(1) – update package
bpkg-pkg-test(1) – test package
bpkg-pkg-clean(1) – clean package
pkg-verify archive
bpkg-pkg-verify(1) – verify package archive
bpkg-pkg-fetch(1) – fetch package archive
bpkg-pkg-unpack(1) – unpack package archive
bpkg-pkg-configure(1) – configure package
bpkg-pkg-disfigure(1) – disfigure package
bpkg-pkg-purge(1) – purge package


bpkg-common-options(1) – details on common options
bpkg-repository-signing(1) – how to sign repository


The common options are summarized below with a more detailed description available in bpkg-common-options(1).

Print essential underlying commands being executed.
Print all underlying commands being executed.
Run quietly, only printing error messages.
--verbose level
Set the diagnostics verbosity to level between 0 and 6.
--build path
The build program to be used to build packages.
--build-option opt
Additional option to be passed to the build program.
--fetch path
The fetch program to be used to download resources.
--fetch-option opt
Additional option to be passed to the fetch program.
--sha256 path
The sha256 program to be used to calculate SHA256 sums.
--sha256-option opt
Additional option to be passed to the sha256 program.
--tar path
The tar program to be used to extract package archives.
--tar-option opt
Additional option to be passed to the tar program.
--openssl path
The openssl program to be used for crypto operations.
--openssl-option opt
Additional option to be passed to the openssl program.
--auth type
Types of repositories to authenticate.
--trust fingerprint
Trust repository certificate with a SHA256 fingerprint.
Assume the answer to all authentication prompts is yes.
Assume the answer to all authentication prompts is no.
--pager path
The pager program to be used to show long text.
--pager-option opt
Additional option to be passed to the pager program.
--options-file file
Read additional options from file.


Non-zero exit status is returned in case of an error.


Send bug reports to the mailing list.