Void Linux Package Management: APT, DNF, Pacman Guide
Void Linux is an independent, rolling-release distribution built from scratch — not derived from Debian, Red Hat, or Arch. Because of this independence, it uses its own package manager called XBPS (X Binary Package System). If you're coming from Ubuntu, Fedora, or Arch Linux, the transition can feel disorienting at first. This guide bridges that gap by translating familiar commands from apt, dnf, and pacman into their xbps equivalents, while also covering best practices unique to Void.
Why Package Management on Void Matters
Package management is the backbone of any Linux system, but on Void it carries extra weight. Void uses the runit init system instead of systemd, and packages are built against the musl or glibc C library depending on which flavor you installed. Understanding XBPS is essential because:
- It handles both binary and source builds via
xbps-src. - It manages the runit service symlinks automatically when you install service packages.
- It performs transactional, dependency-aware operations that can be safely interrupted and resumed.
- It supports partial upgrades and reinstallation of packages from different repositories.
Mastering XBPS lets you maintain a stable, up-to-date rolling system without the surprises that catch many new Void users off guard.
Getting Started with XBPS
The primary command is xbps-install for installing, xbps-query for searching and inspecting, xbps-remove for uninstalling, and xbps-src for building from source. The umbrella command xbps also exists, but most users invoke the subcommands directly.
Updating the Package Index
Before installing or upgrading anything, you must sync the local package database with the remote repositories. Here's how each ecosystem handles this:
# Debian / Ubuntu (APT)
sudo apt update
# Fedora (DNF)
sudo dnf check-update
# Arch (Pacman)
sudo pacman -Sy
# Void Linux (XBPS)
sudo xbps-install -S
The -S flag tells XBPS to synchronize the repository index. Unlike pacman -Sy, which can lead to partial upgrades if you install packages without upgrading the whole system, XBPS is designed to handle this more gracefully — but you should still prefer full system upgrades on a rolling release.
Installing Packages
Installing software is the most common operation. Note that XBPS will automatically enable any associated runit service symlinks under /var/service only if the package ships a service file, but it will not start the service for you — you must do that manually.
# APT
sudo apt install nginx
# DNF
sudo dnf install nginx
# Pacman
sudo pacman -S nginx
# XBPS
sudo xbps-install nginx
To install multiple packages at once, simply list them:
sudo xbps-install nginx postgresql redis
Searching for Packages
Searching differs significantly across package managers. XBPS uses xbps-query with regex support by default.
# APT
apt search web server
# DNF
dnf search web server
# Pacman
pacman -Ss web server
# XBPS
xbps-query -Rs "web server"
The -R flag restricts the search to remote repositories, and -s performs the search against package names and descriptions. To search only local installed packages, drop the -R flag.
Removing Packages
Removing packages in XBPS is straightforward, but cleaning up orphaned dependencies requires an extra step.
# APT
sudo apt remove nginx
sudo apt autoremove
# DNF
sudo dnf remove nginx
sudo dnf autoremove
# Pacman
sudo pacman -R nginx
sudo pacman -Rs nginx # remove with unused deps
# XBPS
sudo xbps-remove nginx
sudo xbps-remove -o # remove orphaned packages
The -o (or --remove-orphans) flag is the XBPS equivalent of autoremove. Run it periodically to keep your system lean.
System Upgrades
Full System Upgrade
On a rolling-release distribution like Void, regular full upgrades are critical. Void does not support partial upgrades safely — mixing old and new packages can break your system. Always upgrade the entire system at once.
# APT
sudo apt update && sudo apt upgrade
# DNF
sudo dnf upgrade
# Pacman
sudo pacman -Syu
# XBPS
sudo xbps-install -Su
The -S flag syncs the index and -u upgrades all outdated packages. If a kernel update is included, XBPS will install the new kernel alongside the old one rather than replacing it in place, which means you can safely reboot when convenient.
Handling Kernel Updates
Void installs new kernels as separate packages (e.g., linux6.6) rather than overwriting a single linux package. Old kernels are retained until you explicitly remove them. To clean up old kernels:
# List installed kernels
xbps-query -l | grep linux
# Remove an old kernel version
sudo xbps-remove linux5.15 linux5.15-headers
Be careful not to remove the kernel you are currently running. Check your active kernel with uname -r before removing anything.
Querying Package Information
Viewing Package Details
# APT
apt show nginx
# DNF
dnf info nginx
# Pacman
pacman -Si nginx # remote
pacman -Qi nginx # local/installed
# XBPS
xbps-query -R nginx # remote
xbps-query nginx # installed
Listing Installed Packages
# APT
dpkg -l
# DNF
dnf list installed
# Pacman
pacman -Q
# XBPS
xbps-query -l
To list files owned by an installed package:
# Pacman
pacman -Ql nginx
# XBPS
xbps-query -f nginx
To find which package owns a specific file:
# Pacman
pacman -Qo /usr/bin/nginx
# XBPS
xbps-query -o /usr/bin/nginx
Repository Management
Void uses a plain-text file at /etc/xbps.d/ for repository configuration. The default repository file is typically /etc/xbps.d/00-repository-main.conf. To enable the non-free repository, for example:
# Create a custom configuration file
sudo mkdir -p /etc/xbps.d
sudo cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
# Edit or add non-free repository
echo "repository=https://alpha.de.repo.voidlinux.org/current/nonfree" | \
sudo tee /etc/xbps.d/10-repository-nonfree.conf
# Sync the new repository
sudo xbps-install -S
Compare this to other ecosystems:
# APT - add to /etc/apt/sources.list or /etc/apt/sources.list.d/
# DNF - edit /etc/yum.repos.d/*.repo
# Pacman - edit /etc/pacman.conf
Mirrors and Repository URLs
Void's repository URLs point to mirrors. If a mirror is slow, you can switch by editing the configuration files in /etc/xbps.d/. Always verify the mirror supports your architecture (glibc or musl) and your release channel (current or a specific dated release).
Building from Source with xbps-src
One of Void's standout features is xbps-src, the source build system. It lets you compile packages locally, modify templates, and install software not available in the binary repositories. This is conceptually similar to the AUR on Arch, but integrated into the official tooling.
# Clone the void-packages repository
git clone https://github.com/void-linux/void-packages.git
cd void-packages
# Bootstrap the build environment
./xbps-src binary-bootstrap
# Build a package
./xbps-src pkg st
# Install the built package
sudo xbps-install --repository hostdir/binpkgs st
If you are on a musl-based system, you must cross-compile or use the correct bootstrap:
./xbps-src binary-bootstrap x86_64-musl
Service Management with runit
Since Void uses runit instead of systemd, service management differs from Debian and Fedora. After installing a service package, you must explicitly enable and start it.
# Enable a service (creates symlink in /var/service)
sudo ln -s /etc/sv/nginx /var/service/
# Start / stop / restart
sudo sv up nginx
sudo sv down nginx
sudo sv restart nginx
# Check status
sudo sv status nginx
On systemd-based systems, the equivalent would be:
sudo systemctl enable --now nginx
Best Practices
- Upgrade regularly. On a rolling release, long gaps between upgrades lead to complex dependency conflicts. Aim for weekly updates at minimum.
- Always use
-Sufor upgrades. Never install a single package on an outdated system without upgrading first — partial upgrades are unsupported and can break your system. - Read the output. XBPS prints important messages about configuration file changes, service symlinks, and manual intervention steps. Do not blindly accept all prompts.
- Clean orphans periodically. Run
sudo xbps-remove -oafter removing packages to reclaim space and avoid stale dependencies. - Keep old kernels until you confirm the new one boots. Reboot into the new kernel, verify everything works, then remove the old one.
- Use
xbps-srcfor custom or restricted software. It keeps your builds reproducible and integrated with the package database. - Back up
/etcbefore major upgrades. Void occasionally migrates configuration formats, and having a backup saves recovery time. - Pin critical packages if needed. You can hold a package by adding it to
ignorepkgin/etc/xbps.d/:
echo "ignorepkg=linux6.6" | sudo tee /etc/xbps.d/99-ignore.conf
Quick Reference Cheat Sheet
| Action | APT | DNF | Pacman | XBPS |
|---------------------|----------------------|--------------------|---------------|---------------------|
| Sync index | apt update | dnf check-update | pacman -Sy | xbps-install -S |
| Install package | apt install pkg | dnf install pkg | pacman -S pkg | xbps-install pkg |
| Remove package | apt remove pkg | dnf remove pkg | pacman -R pkg | xbps-remove pkg |
| Remove orphans | apt autoremove | dnf autoremove | pacman -Rs | xbps-remove -o |
| Search | apt search term | dnf search term | pacman -Ss | xbps-query -Rs |
| Show info | apt show pkg | dnf info pkg | pacman -Si | xbps-query -R pkg |
| Upgrade system | apt upgrade | dnf upgrade | pacman -Syu | xbps-install -Su |
| List installed | dpkg -l | dnf list installed | pacman -Q | xbps-query -l |
| Owns file | dpkg -S /path | dnf provides /path | pacman -Qo | xbps-query -o /path |
| Clean cache | apt clean | dnf clean all | pacman -Sc | xbps-remove -O |
Conclusion
Void Linux's XBPS is a fast, reliable, and transactional package manager that rewards understanding. While the command syntax differs from apt, dnf, and pacman, the underlying concepts map cleanly across ecosystems. By learning the XBPS equivalents of common operations, embracing full-system upgrades, cleaning up orphaned packages, and leveraging xbps-src for custom builds, you can maintain a clean and stable Void installation. The independence that makes Void different is also what makes it powerful — and with this translation guide in hand, you are well equipped to make the switch with confidence.