xbps-uhelper(1)

XBPS-UHELPER(1) General Commands Manual XBPS-UHELPER(1)

NAME

xbps-uhelperXBPS helper utilities

SYNOPSIS

xbps-uhelper [OPTIONS] ACTION [ARGUMENTS]

DESCRIPTION

The xbps-uhelper utility provides various utilities for interacting with XBPS and XBPS packages.

ARGUMENT TYPES

BINPKG

A binpkg argument is a string of the format <pkgname>-<version>_<revision>.<arch>.xbps, like the filename of a binary package.

PKGVER

A pkgver argument is a string of the format <pkgname>-<version>_<revision>, like the pkgver property.

PKGPATTERN

A pkgpattern argument is package expression 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

Example: “foo>=2.0”.

OPTIONS

-C, --config dir
Specifies a path to the XBPS configuration directory. If the first character is not '/' then it's a relative path of rootdir.
-d, --debug
Enables extra debugging shown to stderr.
-h, --help
Show the help message.
-r, --rootdir dir
Specifies a full path for the target root directory.
-v, --verbose
Enables verbose messages.
-V, --version
Show the version information.

ACTIONS

arch
Prints the XBPS native arch.
binpkgarch binpkg ...
Prints the arch of binpkg strings.
binpkgver binpkg ...
Prints the pkgver of binpkg strings.
cmpver instver reqver
Compare two pkgver strings, instver (installed) vs reqver (required). See EXIT STATUS for more information. If --verbose is specified, also prints "instver <|=|> reqver".
getname string ...
Prints the pkgname of pkgpatterns and/or pkgvers. This is a combination of getpkgdepname and getpkgname.
getversion string ...
Prints the version of pkgpatterns and/or pkgvers. This is a combination of getpkgdepversion and getpkgversion.
getpkgdepname pkgpattern ...
Prints the pkgname of package dependency patterns.
getpkgdepversion pkgpattern
Prints the version of package dependency patterns.
getpkgname pkgver ...
Prints the name of package strings.
getpkgrevision pkgver ...
Prints the revision of package strings.
getpkgversion pkgver ...
Prints the version of package strings.
getsystemdir
Prints the xbps system directory (<sharedir>/xbps.d).
pkgmatch pkgver pkgpattern
Matches a pkgver with a pkgpattern. See EXIT STATUS for more information. If --verbose is specified, also prints "pkgver matches|does not match pkgpattern", or an error.
real-version pkgname ...
Prints the version of installed real packages.
version pkgname ...
Prints the version of installed packages.

EXIT STATUS

The xbps-uhelper utility exits 0 on success, and >0 if an error occurs. A descriptive error message will be printed to stderr. Exceptions to this are:

cmpver instver reqver
1
if instver is greater than reqver.
0
if instver is equal to reqver.
255
if instver is less than reqver.
pkgmatch pkgver pkgpattern
1
pkgver matches pkgpattern.
0
pkgver does not match pkgpattern.
255
An error occurred.

EXAMPLES

Compare package versions:

$ xbps-uhelper cmpver 'foo-1.0_1' 'foo-2.1_1'
$ xbps-uhelper cmpver 1.0 2.1

Get the package name for dependency pattern “foo>=0”:

$ xbps-uhelper getpkgdepname 'foo>=0'

Get the version expression for the dependency pattern “foo>=0”:

$ xbps-uhelper getpkgdepversion 'foo>=0'

Get the package name for pkgver “foo-2.0_1”:

$ xbps-uhelper getpkgname foo-2.0_1

Get the revision for pkgver “foo-2.0_1”:

$ xbps-uhelper getpkgrevision foo-2.0_1

Get the version for pkgver “foo-2.0_1”:

$ xbps-uhelper getpkgversion foo-2.0_1

Check if the pkgver “foo-1.0_1” matches the dependency pattern “foo>=1.0”:

$ xbps-uhelper pkgmatch foo-1.0_1 'foo>=1.0'

Get the version for the installed package “foo”:

$ xbps-uhelper version foo

Get the names of packages from a list of pkgvers:

$ xbps-query -Rp pkgver -s foo | cut -d: -f1 | xargs xbps-uhelper getpkgname

Get the names of dependencies for a package:

$ xbps-query -Rp run_depends xf86-video-amdgpu | xargs xbps-uhelper getname

ENVIRONMENT

XBPS_ARCH
Overrides uname(2) machine result with this value. Useful to install packages with a fake architecture.
XBPS_TARGET_ARCH
Sets the target architecture to this value. This variable differs from XBPS_ARCH in that it allows you to install packages partially, because configuration phase is skipped (the target binaries might not be compatible with the native architecture).

FILES

/etc/xbps.d
Default configuration directory.
/usr/share/xbps.d
Default system configuration directory.
/var/db/xbps/.<pkgname>-files.plist
Package files metadata.
/var/db/xbps/pkgdb-0.38.plist
Default package database (0.38 format). Keeps track of installed packages and properties.
/var/cache/xbps
Default cache directory to store downloaded binary packages.

SEE ALSO

xbps-checkvers(1), xbps-create(1), xbps-dgraph(1), xbps-digest(1), xbps-fbulk(1), xbps-fetch(1), xbps-install(1), xbps-pkgdb(1), xbps-query(1), xbps-reconfigure(1), xbps-remove(1), xbps-rindex(1), xbps-uchroot(1), xbps-uunshare(1), xbps.d(5)

AUTHORS

Juan Romero Pardines <xtraeme@gmail.com>

BUGS

Report bugs at https://github.com/void-linux/xbps/issues

February 11, 2023 Linux 6.12.85-6.12-alt1