The xbps package includes the following utilities:
*`xbps-create (8)` - XBPS utility to create binary packages
*`xbps-dgraph (8)` - XBPS utility to generate dot(1) graphs
*`xbps-install (8)` - XBPS utility to install and update packages
*`xbps-pkgdb (8)` - XBPS utility to report and fix issues in pkgdb
*`xbps-query (8)` - XBPS utility to query for package and repository information
*`xbps-reconfigure (8)` - XBPS utility to configure installed packages
*`xbps-remove (8)` - XBPS utility to remove packages
*`xbps-rindex (8)` - 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 or equal than
*`>=` greater or equal than
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
> **NOTE** 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.
> **NOTE** If no repositories are found it's possible to declare them manually via the command line option `--repository`, currently accepted in `xbps-install(8)` and `xbps-query(8)`.
### xbps-query - querying packages and repositories
> xbps-query(8) 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 <packageexpression>
> 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 <packageexpression>
To query a package and show required run-time dependencies:
$ xbps-query -x <packageexpression>
To query a package and show required reverse run-time dependencies:
$ xbps-query -X <packageexpression>
To query for packages matching a file with specified pattern(s) (ownedby mode):
$ xbps-query -o <pattern>
> Where `<pattern>` is a shell wildcard pattern as explained in fnmatch(3); e.g `"*.png"`.
> Multiple `<patterns>` can be specified as arguments.
To query for packages matching pkgname/version/description with specified pattern(s) (search mode):
$ xbps-query -s <pattern>
> The same rules explained above in the `ownedby` mode shall be applied.
### xbps-install - installing and updating packages
To synchronize remote repository index files:
$ xbps-install -S
> The `-S, --sync` option can be combined while installing or updating packages, i.e `xbps-install -Su`.
To update all packages (also known as dist-upgrade in debian/ubuntu):
$ xbps-install -u
> The `-n, --dry-run` option can be used to print what packages will be updated and/or installed and doesn't need permissions in the target rootdir, which can be useful to list updates.
### xbps-remove - removing packages
To remove a package:
$ xbps-remove <packagename>
To recursively remove unneeded dependencies that were installed by the target package:
$ xbps-remove -R <packagename>
To remove package orphans:
$ xbps-remove -o
To clean the cache directory and remove outdated packages and/or packages with wrong hash:
$ xbps-remove -O
> To remove package orphans and clean the cache repository both options can be combined, i.e `xbps-remove -Oo`.
### xbps-reconfigure - configure (or force configuration of) a package
The `xbps-reconfigure(8)` utility may be used to configure packages that were not previously
(perhaps due to a power outage, process killed, etc) or simply to force package
reconfiguration. By default and unless the `-f, --force` option is set, only packages that
were not configured will be processed.
Its usage is simple, specify a package name or `a, --all` for all packages:
$ xbps-reconfigure [-f] <packagename> | -a
### xbps-pkgdb - checking for errors in packages and pkgdb
The `xbps-pkgdb(8)` utility may be used to check for errors in packages and in the package database.