Xbps package manager
Cheat Sheet

The xbps package manager is the package management system used by Void Linux. Below is a cheat sheet that outlines some of the most common commands you might use when managing packages with xbps.

Updating Package Database

sudo xbps-install -S  # Synchronize the repositories and update the package list

Installing Packages

sudo xbps-install -y <package_name>  # Install a package and answer yes to any prompts

Removing Packages

sudo xbps-remove <package_name>        # Remove a package
sudo xbps-remove -R <package_name>     # Remove a package and its dependencies (if not needed by other packages)
sudo xbps-remove -O                    # Remove obsolete packages (packages that no longer exist in the repositories)

Searching for Packages

xbps-query -Rs <search_term>  # Search for a package in the repositories

Package Information

xbps-query <package_name>              # Display information about a package
xbps-query -R <package_name>           # Display information about a package in the repositories
xbps-query -l                          # List all installed packages
xbps-query -L                          # List all repositories

Updating System

sudo xbps-install -Su  # Update all packages to the latest versions

Managing Hold/Ignore Packages

xbps-pkgdb -m hold <package_name>      # Prevent a package from being updated
xbps-pkgdb -m unhold <package_name>    # Remove the hold status from a package

Handling Configuration Files

xbps-diff -C                          # Check for differences between pkg-provided and user-modified config files

Cleaning the Cache

sudo xbps-remove -O                    # Remove unneeded/obsolete packages from the cache
sudo xbps-remove -o                    # Remove only cached packages that aren't installed

Fixing Package States

sudo xbps-pkgdb -a                    # Check for and fix any issues with package integrity

Managing Repositories

sudo xbps-install -r <custom_repo> <package_name>  # Install a package from a specific repository

Upgrading Specific Package

sudo xbps-install -u <package_name>   # Upgrade a specific package to the latest version

Downgrading Packages

sudo xbps-install -f <package_name>-<version>  # Force install a specific version of a package, effectively downgrading it

Locking Package Version (Alternative to Hold)

echo "<package_name>=<version_ignored>" | sudo tee -a /etc/xbps.d/10-ignore-version.conf  # Ignore updates for a specific version of a package

Verify Package Integrity

xbps-pkgdb -a                        # Verify the integrity of all packages

Reconfigure Package

sudo xbps-reconfigure -f <package_name>  # Reconfigure a package, possibly after manual changes to its configuration
Remember to replace <package_name> with the actual name of the package and <version> with the specific version number you want to install or hold. Also, <search_term> is the term you're searching for in the repositories, and <custom_repo> is the custom repository's name or URL you want to use.

Always use these commands with caution and make sure you understand what each command does before running it. Depending on the system’s configuration, some commands may require elevated privileges; hence the use of sudo.

Author: madam

Created: 2024-01-18 Do 11:33