XBPS is the default command line package manager tool in Void Linux. Here’s how to use it to install, remove, update, and upgrade packages in Void Linux in a breeze.
Table of Contents
- Void Linux Repositories
- Update Package Lists
- Searching for Packages
- Searching Through Installed Packages
- Installing and Updating Packages
- Removing Packages
- Get Details About Package
- Installing Packages from Source
Void Linux is an independently developed, rolling-release, general-purpose operating system. It’s built from scratch, which means it is not based on any of the main distros we know. In addition, Void is arguably the most BSD-like of all Linux distributions.
One of the reasons to consider using Void is the excellent package management system.
XBPS (X Binary Package System) is the package manager that’s used on Void Linux. It was originally written for Void from scratch, but it’s supposed to be also a portable package manager you could theoretically use somewhere else.
You’ll probably notice that there’s no
xbps man page and no individual
xbps binary because XBPS is a collection of programs that are pretty much related and similar in structure. Still, of course, they’re different commands.
Even though the XBPS package manager has many advanced features, basic software management operations are accomplished with four command-line programs.
xbps-queryfor querying the repositories and the installed system.
xbps-installfor updates and installations.
xbps-srcfor building packages distributed by third parties as source archives.
An installation package in Void Linux consists of one
.xbps file and an associated
.xbps.sig file, which is used to install a particular piece of software on a Void system.
Void Linux Repositories
By default, Void Linux only has free software. In other words, there’s a division between free software and non-free software. If you want to install non-free software on your Void Linux system, you need to install the following extra repository:
Just type in terminal:
sudo xbps-install -S void-repo-nonfree void-repo-multilib-nonfree
To query the list of working repositories, add the
--list-repos) option to the
Update Package Lists
Like all package managers, XBPS uses repositories to obtain packages. And like any other system, it’s important to keep your Void system up-to-date.
xbps-install -Su command (
--update) downloads up-to-date information about available software packages:
sudo xbps-install -Su
This downloads the latest up-to-date software packages and their metadata – package names, version numbers, etc.
Searching for Packages
To search available repositories for packages, use the
xbps-query command. This utility in XBPS enables you to search for the required package and the information on the repository.
To search for a specific package, for example,
vlc, in the remote repositories, run:
xbps-query -Rs vlc
--repository) option enables repository mode, and
--search) searches for packages by matching patterns. In our case, it looks for
vlc-related packages, so everything that has
vlc either in the name or the description will pop up.
Searching Through Installed Packages
What if you want to list specific currently installed packages only? Just pass the
--list-pkgs) option to the
xbps-query command and pipe the output using the
For example, to find all the packages currently installed on your Void Linux system which contain the
vlc within their name, run:
xbps-query -l | grep vlc
Installing and Updating Packages
xbps-install command enables you to install, reinstall, or update packages as required by the use case.
--sync) option to the
xbps-install command is recommended, which updates the package index to ensure you’re getting the most recent version.
So if you want to install something, for example,
sudo xbps-install -S vlc
As you can see from the image above,
xbps-install will automatically identify all the necessary dependencies and take care of them.
xbps-remove utility removes installed packages from the system. Adding the
--recursive) option to the command removes unneeded dependencies that were installed by the target package.
To remove a package with all its dependencies, for example,
vlc, run the following command:
sudo xbps-remove -R vlc
Get Details About Package
xbps-query -Rs command gives you a brief introduction to the packages. If you want more details, use the
xbps-query command with only the
--repository) option added.
For example, to display the detailed information from the sync database about the vlc package, run:
xbps-query -R vlc
Installing Packages from Source
xbps-src itself is nothing but a Bash shell script that allows you to build and install source packages from Void’s GitHub repository into Void’s binaries that you can use XBPS to install. You would use it mainly to install packages that are not in the official repositories.
The core of Void’s method of organizing source package directories, build directories, and associated build system paths is a clone of Void’s GitHub repository of source packages.
Therefore, make sure that you have the
git package installed. Run this command in your terminal if it is not.
sudo xbps-install -S git
Then you will need to clone the Void’s packages repository from GitHub.
git clone https://github.com/void-linux/void-packages.git
This will create the directory
void-packages with the source tree of all Void packages in
cd into the newly created directory and install the binary bootstrap required to build the binary packages in isolation.
cd void-packages ./xbps-src binary-bootstrap
For this guide, I am going to install the Google Chrome browser. This will work for any package, though.
First, enable restricted packages:
echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
The package is built with:
./xbps-src pkg google-chrome
The above process places the built binary package in the
Finally, the package can be installed with:
sudo xbps-install --repository=hostdir/binpkgs/nonfree google-chrome
This guide has covered most of the commands you need to know when using the XBPS package manager. Hopefully, it was helpful in your journey with Void Linux.
Comparable to Arch or Gentoo, Void can be turned into whatever you wish to assemble. Here’s our excellent step-by-step tutorial, which will guide you through all the steps of the installation: How to Install Void Linux: A Complete Step-by-Step Guide
You can find detailed documentation about the XBPS package manager in the official Void Linux Handbook.