XBPS-UHELPER(1)
π xbps-uhelper β the little helper that does it ALL, bestie
okay so picture this: you're deep in XBPS land, you've got package strings flying everywhere, and you just need to know what is the name, what is the version, does this even match β and that's literally what xbps-uhelper from the XBPS manual is here for. It's a grab-bag of tiny utilities for poking at XBPS and XBPS packages, and honestly it eats. π
β¨ SYNOPSIS β¨
xbps-uhelper [OPTIONS] ACTION [ARGUMENTS]
no cap, that's the whole shape of it: options first, then the action, then whatever arguments that action wants. slay. π«Ά
πΈ DESCRIPTION πΈ
The xbps-uhelper utility provides various utilities for interacting with XBPS and XBPS packages.
lowkey it's the utility belt of the XBPS cinematic universe β every little string-parsing, version-comparing, name-extracting task you could want. main character energy fr fr. π
π¦ ARGUMENT TYPES π¦
before we get into the actions, we gotta talk about the flavors of string this thing snacks on. there are three, and yes you need to know them.
π BINPKG
A binpkg argument is a string of the format <pkgname>-<version>_<revision>.<arch>.xbps, like the filename of a binary package.
so basically the whole filename, with everything in it. iconic.
π§ PKGVER
A pkgver argument is a string of the format <pkgname>-<version>_<revision>, like the pkgver property.
same energy as a binpkg but the arch part dipped. π
β 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β.
that's it, that's the pattern. compara-tor and all. π―
π OPTIONS π
every single flag, bestie, no skips:
-C,--configdir β Specifies a path to the XBPS configuration directory. If the first character is not/then it's a relative path ofrootdir.-d,--debugβ Enables extra debugging shown tostderr.-h,--helpβ Show the help message. bestie behavior honestly.-r,--rootdirdir β Specifies a full path for the target root directory.-v,--verboseβ Enables verbose messages.-V,--versionβ Show the version information.
ngl-Cis a sneaky one: relative means relative torootdir, not to wherever you happen to be standing. noted. π
π₯ ACTIONS π₯
here's the whole menu. pick your fighter.
archβ Prints the XBPS native arch.binpkgarchbinpkg ... β Prints the arch ofbinpkgstrings.binpkgverbinpkg ... β Prints thepkgverofbinpkgstrings.cmpverinstver reqver β Compare twopkgverstrings, instver (installed) vs reqver (required). See βEXIT STATUSβ for more information. If--verboseis specified, also prints"instver <|=|> reqver".getnamestring ... β Prints thepkgnameofpkgpatterns and/orpkgvers. This is a combination ofgetpkgdepnameandgetpkgname.getversionstring ... β Prints the version ofpkgpatterns and/orpkgvers. This is a combination ofgetpkgdepversionandgetpkgversion.getpkgdepnamepkgpattern ... β Prints thepkgnameof package dependency patterns.getpkgdepversionpkgpattern β Prints the version of package dependency patterns.getpkgnamepkgver ... β Prints the name of package strings.getpkgrevisionpkgver ... β Prints the revision of package strings.getpkgversionpkgver ... β Prints the version of package strings.getsystemdirβ Prints the xbps system directory (<sharedir>/xbps.d).pkgmatchpkgver pkgpattern β Matches apkgverwith apkgpattern. See βEXIT STATUSβ for more information. If--verboseis specified, also prints"pkgver matches|does not match pkgpattern", or an error.real-versionpkgname ... β Prints the version of installed real packages.versionpkgname ... β Prints the version of installed packages.
π«Ά tiny heads-up:getpkgdepversionandpkgmatcheach take things a little differently than their neighbors β check the arg shapes above before you yeet a whole list at them.
π EXIT STATUS π
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.
π okay so yes, these two flip the usual "0 means good" thing β pay attention, becausecmpverreturning1is "installed is newer" and0is "same version", which is not what your shell instincts are screaming at you. andpkgmatchreturning1means it matches. do not get got by this. π
π EXAMPLES π
these are the moments. the whole vibe. β¨
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
π§ that last two? pipingxbps-querystraight intoxargs xbps-uhelperis the move. it's giving productivity. it's giving pipeline. obsessed.
π ENVIRONMENT π
XBPS_ARCHβ Overridesuname(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 fromXBPS_ARCHin that it allows you to install packages partially, because configuration phase is skipped (the target binaries might not be compatible with the native architecture).
β real talk: XBPS_TARGET_ARCH is the wild one β it lets you install packages partially because the configuration phase gets skipped, and that's exactly because the target binaries might not be compatible with your native architecture. don't say i didn't warn you. π«Ά
π FILES π
eyeballs on these paths, bestie:
/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 πΈ
the whole friend group, literally: 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).
go say hi. π
π AUTHORS π
Juan Romero Pardines <xtraeme@gmail.com> β the icon who made this. π
π¦ BUGS π¦
Report bugs at https://github.com/void-linux/xbps/issues
(and pls be nice about it, bug reports are a love language π«Ά)
k bye bestie β this was XBPS-UHELPER(1), general commands manual, from the Debian build dated Feb 11, 2023. go parse some package strings and slay β¨π
π
π¦ where this page comes from
- alpine 3.24: xbps-doc 0.60.6-r1 Β· BSD-2-Clause AND BSD-3-Clause AND ISC
- nixos 26.05: xbps 0.60.7
- nixpkgs unstable: xbps 0.60.7
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms