XBPS & xtools Cheatsheet

[Void Linux]

XBPS (X Binary Package System) is Void's native package manager written entirely from scratch in C and is not monolithic, meaning it won't accidentally break your system if a major upgrade gets interrupted.

But typing the entire commands for it all the time can get a little exhausting, so the Void community created a package called xtools that gives you some amazing ultra-short aliases. Make sure it's installed:

sudo xbps-install xtools

This cheatsheet doesn't list out everything these utilities are capable of but just enough to get you started with most of everything.

Installing & System Upgrades

  • Install a package:
    sudo xbps-install <package_name> or xi <pkg>
  • Synchronize repositories:
    sudo xbps-install -S or xi
  • Synchronize repositories and do a full upgrade:
    sudo xbps-install -Syu or xi -Syu
  • Re-download and force reinstall an already-installed package:
    sudo xbps-install -f <package_name> or xi -f <package_name>
  • Install a local .xbps package file:
    sudo xbps-install --repository=/path/to/folder/ <package_name>
    or xi --repository=/path/to/folder/ <package_name>

Querying

  • Search for a package in the repos:
    xbps-query -Rs <package_keyword> or xq -Rs <pkg>
  • List all locally installed packages:
    xbps-query -l or xpkg
  • Get details about a remote package:
    xbps-query -R <package_name> or xq -R <pkg>
  • List the files owned/installed by a package:
    xbps-query -f <package_name> or xls <pkg>
  • Find out which package owns a specific file path locally:
    xbps-query -o /usr/bin/executable or xlocate <file> and xlocate works even if the package isn't installed.

Note that standard operations (install, remove, upgrade) require sudo or root privileges but queries do not.

Removing packages

  • Remove a package:
    sudo xbps-remove <package_name>
  • Remove a package and all its unused dependencies:
    sudo xbps-remove -R <package_name>
  • Clean up orphan packages:
    sudo xbps-remove -o
  • Clear the package download cache which is in /var/cache/xbps/:
    sudo xbps-remove -O
  • If you want to combine both of the 2 commands above:
    sudo xbps-remove -oO

xtools does not provide an alias for xbps-remove.

Advanced stuff

  • Lock/Hold a package version to prevent it from updating:
    sudo xbps-pkgdb -m hold <package_name>
    And to unhold it just do unhold instead.
  • List all packages currently on hold:
    xbps-query -H or xpkg -H
  • Check which running processes need a restart after an update:
    xcheckrestart
  • See which installed packages take up the most disk space:
    xhog