SkillAgentSearch skills...

Xbps

The X Binary Package System (XBPS)

Install / Use

/learn @void-linux/Xbps
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Packaging status

Tests CodeQL Coverity Scan Build Status

XBPS

The X Binary Package System (in short XBPS) is a binary package system designed and implemented from scratch. Its goal is to be fast, easy to use, bug-free, featureful and portable as much as possible.

The XBPS code is totally compatible with POSIX/SUSv2/C99 standards, and released with a Simplified BSD license (2 clause). There is a well documented API provided by the XBPS Library that is the basis for its frontends to handle binary packages and repositories. Some highlights:

  • Supports multiple local/remote repositories (HTTP/HTTPS/FTP).
  • RSA signed remote repositories (NEW in 0.27).
  • Supports multiple compression formats for repositories: gzip (zlib), bzip2, lz4, xz, zstd (default).
  • Supports multiple compression formats for package archives: gzip (zlib), bzip2, lz4, xz, zstd (default).
  • SHA256 hashes for package metadata, files and binary packages.
  • Supports package states (ala dpkg) to mitigate broken package installs/updates.
  • Ability to resume partial package install/updates.
  • Ability to unpack only files that have been modified in package updates.
  • Ability to use virtual packages.
  • Ability to ignore completely any number of packages in dependency resolution.
  • Ability to check for incompatible shared libraries in reverse dependencies.
  • Ability to update reverse dependencies of any number of packages or globally in a single transaction.
  • Ability to replace packages.
  • Ability to put packages on hold (to never update them. NEW in 0.16).
  • Ability to preserve/update configuration files.
  • Ability to force reinstallation of any installed package.
  • Ability to downgrade any installed package.
  • Ability to execute pre/post install/remove/update scriptlets.
  • Ability to check package integrity: missing files, hashes, missing or unresolved (reverse)dependencies, dangling or modified symlinks, etc.

XBPS contains an almost complete test suite, currently with ~200 test cases, and its number is growing daily! If you find any issue and you can reproduce it, we will fix it and a new test case will be created. No more regressions!

XBPS is brought to you by:

and many other contributors in the free community that have helped improving it. See the AUTHORS file for a complete list of contributors.

Thanks to all who have contributed.

Build requirements

To build this you'll need:

and optionally:

Building and testing for dummies

$ git clone https://github.com/void-linux/xbps
$ cd xbps
$ ./configure --enable-rpath --prefix=/usr --sysconfdir=/etc
$ make -j$(nproc)
$ make DESTDIR=~/xbps-git install clean
$ export PATH=~/xbps-git/usr/bin:$PATH
$ xbps-query -V
...

Thanks to --enable-rpath you can install it anywhere and it will still use the libxbps shared library at $ORIGIN/../lib, that means that if xbps is installed to $HOME/xbps-git/usr, the executables will use $HOME/xbps-git/usr/lib to locate libxbps.

Happy testing!

Tests

To run the test suite make sure kyua is installed and run the following:

$ ./configure --enable-tests
$ make
$ make check

Build instructions

Standard configure script (not generated by GNU autoconf).

$ ./configure --prefix=/blah
$ make -jX
$ make install

By default PREFIX is set /usr/local and may be changed by setting --prefix in the configure script. The DESTDIR variable is also supported at the install stage.

There are some more options that can be tweaked, see them with ./configure --help.

Good luck!

Binaries

Binaries for Linux compiled statically with the musl C library are available:

These builds are available on all official void mirrors, along with their sha256 checksums.

Usage instructions

The xbps package includes the following utilities (among others, not a complete list):

  • xbps-create (1) - XBPS utility to create binary packages
  • xbps-dgraph (1) - XBPS utility to generate dot(1) graphs
  • xbps-install (1) - XBPS utility to install and update packages
  • xbps-pkgdb (1) - XBPS utility to report and fix issues in pkgdb
  • xbps-query (1) - XBPS utility to query for package and repository information
  • xbps-reconfigure (1) - XBPS utility to configure installed packages
  • xbps-remove (1) - XBPS utility to remove packages
  • xbps-rindex (1) - XBPS utility to handle local binary package repositories

In the following sections there will be a brief description of how these utilities currently work.

Package expressions

In the following examples there will be commands accepting an argument such as <package expression>. A package expression is a form to match a pattern; currently XBPS >= 0.19 supports 3 ways to specify them:

  • by specifying a package name, i.e foo.

  • by specifying the exact package name and version, i.e foo-1.0_1.

  • by specifying a package name and version separated by any of the following version comparators:

    • < less than
    • > greater than
    • <= less than or equal to
    • >= greater than or equal to

    Such example would be foo>=2.0 or blah-foo<=1.0.

Repositories

Repositories can be declared in a configuration file of the configuration or system configuration directories:

  • <sysconfdir>/xbps.d - The configuration directory (set to /etc/xbps.d)
  • <sharedir>/xbps.d - The system directory (set to /usr/share/xbps.d)

A configuration file bearing the same filename in /etc/xbps.d overrides the one from <sharedir>/xbps.d. By default the XBPS package provides only the main Void repository in the /usr/share/xbps.d/00-repository-main.conf file.

Additional repositories can be added by installing any of the following XBPS packages or creating new configuration files manually:

$ xbps-query -Rs void-repo
[*] void-repo-debug-3_1            Void Linux drop-in file for the debug repository
[*] void-repo-multilib-3_1         Void Linux drop-in file for the multilib repository
[*] void-repo-multilib-nonfree-3_1 Void Linux drop-in file for the multilib/nonfree repository
[*] void-repo-nonfree-3_1          Void Linux drop-in file for the nonfree repository
$

Repositories specified in the configuration directory are added to the head of the list, while repositories specified via system configuration directories are appended to the existing list.

If no repositories are found it's possible to declare them manually via the command line option --repository, currently accepted in xbps-install(1) and xbps-query(1).

xbps-query - querying packages and repositories

xbps-query(1) will try to match <package expression> in local packages. This behaviour can be changed by enabling the -R or --repository option to force repository mode.

To query the list of installed packages:

$ xbps-query -l

To query the list of working repositories:

$ xbps-query -L

To query the list of installed packages that were installed manually (not as dependencies):

$ xbps-query -m

To query the list of packages on hold (won't be upgraded automatically):

$ xbps-query -H

To query the list of installed package orphans (packages that were installed as dependencies but there is not any package currently that requires it):

$ xbps-query -O

To query a package and show its meta information:

$ xbps-query <package expression>

Additionally the -p or --property option can be used to only show a specific key of a package:

$ xbps-query --property=pkgver xbps
xbps-0.19_1
$

Multiple properties can be specified by delimiting them with commas, i.e -p key,key2.

To query a package and show its file list:

$ xbps-query -f <package expression>

To query a package and show required run-time dependencies:

$ xbps-query -x <package expression>

To query a package and show required reverse run-time dependencies:

$ xbps-query -X <package expression>

To query for packages matching a file with specified pattern(s) (ownedby mode

View on GitHub
GitHub Stars1.0k
CategoryDevelopment
Updated5h ago
Forks141

Languages

C

Security Score

85/100

Audited on Mar 27, 2026

No findings