Troubleshooters.Com®, Linux Library, and T.C Void Linux Subsite Present:

Configuring Your Void Linux Computer's Repositories

Contents:

Introduction

Void Linux' package manager is called xbps. Like all package managers, xbps uses repositories (repos) to obtain packages. Like most package managers, xpbs uses different repos for different classes of packages. These class repos are called subrepos. For instance, there's a separate subrepo for nonfree software, and another special subrepo for debug packages. Like all major distro package managers, xbps has repo mirrors in different part of the world in order to get packages to the users with as little Internet usage and delay as possible.

The last decision you make is which mirror. You decide on your subrepos before that.

glibc vs musl

glibc and musl are two different C/POSIX standard library implementations for Linux. The remainder of this document calls them "standard C libraries". The traditional standard C library for Linux is glibc, which is an excellent choice. But in some situations, musl is what you want. If you want a more permissive license, musl uses the permissive MIT license rather than the LGPL2.1 with exceptions. Also, musl produces smaller static executables. A detailed comparison can be found at http://www.etalabs.net/compare_libcs.html. I don't understand most of that document, which is why I personally default to glibc.

NOTE:

Most of the Linux world uses glibc, so most precompiled Linux binaries expect glibc.

Void Linux can be compiled with either glibc or musl. It has packages for each. If you don't have an opinion, or you don't fully understand why you'd choose one standard C library over the other, glibc is your best choice because it's used by a significant majority of Linux installations. If you need musl you'll know it, and Void Linux is one of the few that builds with musl.

When dealing with packages and repositories, the very first question is "glibc or musl?" Those are your two main repos, so once you've chosen one, you go on to select mirrors and subrepos from there.

This Document Doesn't Cover musl, But...

This document doesn't specifically cover musl, but musl users can simply extrapolate the info for glibc to accomplish the same tasks with musl.

Mirrors, Repos and Subrepos

A few definitions now prevent misunderstanding later. A package consists of one .xbps file and associated .sig file, which together are used to install a particular piece or group of software on a Void Linux computer.

A repo, short for repository, is the set of packages comprising a generic Void Linux installation on a particular compiler architecture (glibc or musl). The word can also refer to the standard directory on the Internet containing those packages. The standard Void repo for glibc is https://repo.voidlinux.eu/current/, and the standard Void repo for a musl compiled system is https://repo.voidlinux.eu/current/musl/

A mirror is a copy of the standard repo. As of 11/29/2017, https://repo.voidlinux.eu/current has working mirrors at:

The musl architecture has its own set of mirrors. A reasonably up to date list of mirrors is kept at https://wiki.voidlinux.eu/XBPS#Official_Repositories

A subrepo is a directory containing packages for special software: Typically either debug, nonfree, multiarch, and multiarch-nonfree. Subrepo mirrors can usually be found as a subdirectory inside the directory for the repo. For instance, the nonfree subrepo at the https://lug.utdallas.edu/mirror/void/current mirror has URL https://lug.utdallas.edu/mirror/void/current/nonfree/.

Occasionally the terms repo, subrepo and mirror are interchanged a little too freely in documentation, including this documentation, so you need to understand in the face of minor ambiguity. Don't take these exact terms too literally.

Where to Find Mirrors

Void's official list of mirrors is kept at:

https://wiki.voidlinux.eu/XBPS#Official_Repositories

The Two Mirror Directories On Your Void Computer

Your Void Linux machine has two directories in which XBPS repo mirrors and subrepo mirrors are specified:

The contents of /usr/share/xbps.d should be determined solely by the package manager, so do not modify them with a text editor.

If you want to change the location of a repo or subrepo, simply copy that repo or subrepo's file from /usr/share/xbps.d to /etc/xbps.d, and edit the copy in /etc/xbps.d.

Specifying your Main Repo

A properly installed Void Linux contains a /usr/share/xbps.d/00-repository-main.conf that points to https://repo.voidlinux.eu/current (or https://repo.voidlinux.eu/current/musl if you're using musl).

WARNING:

If /usr/share/xbps.d/00-repository-main.confdoesn't exist, create it containing the following line of content (assuming you're using glibc):

repository=https://repo.voidlinux.eu/current

https://repo.voidlinux.eu/current is great if you live in Europe, but bad news on other continents. So I copied my /usr/share/xbps.d/00-repository-main.conf to /etc/xbps.d/00-repository-main.conf, and changed its contents to the following:

repository=https://lug.utdallas.edu/mirror/void/current

NOTE:

All these repo files like /etc/xbps.d/00-repository-main.conf recognize a poundsign (#) as a comment, so it's often easier to comment out the current content, copy it to another line, uncomment that line, and change it as appropriate. This also gives you a history of the various repos you've used: A handy troubleshooting advantage when trying to figure out an XBPS problem.

When you need a list of repos, you can get a fairly up to date one at the following URL:

https://wiki.voidlinux.eu/XBPS#Official_Repositories

Special Subrepo List Command

NOTE:

Nothing in this section pertains to mirrors. A subrepo is a conceptual collection of package files. A mirror is an actual host/path containing those package files. One subrepo can be represented by many mirrors worldwide.

Someone not a daily Void administrator doesn't, and shouldn't be expected to, know the names of all the subrepos. Luckily, those names are discoverable using the following easy command:

xbps-query -Rs void-repo

The following is an example of the output of the preceding command:

[root@ricardo xbps.d]# xbps-query -Rs void-repo
[-] void-repo-debug-9_1            Void Linux drop-in file for the debug rep...
[-] void-repo-multilib-6_1         Void Linux drop-in file for the multilib ...
[-] void-repo-multilib-nonfree-6_1 Void Linux drop-in file for the multilib/...
[-] void-repo-nonfree-9_1          Void Linux drop-in file for the nonfree r...
[root@ricardo xbps.d]#

In the preceding output, the four current Void Project sponsored subrepos are listed. None is installed: If it were, there would be an asterisk between the square brackets instead of a dash.

The Special Repo Mirror Content Listing Command:

The following command produces a listing of all packages in the Void debug repository at Clarkson University:

xbps-query -i -M  \
--repository=https://mirror.clarkson.edu/voidlinux/current/debug \
-s ''

xbps-query [OPTIONS] MODE [ARGUMENTS], in that order, is specified by the xbps-query man page. The -i and -M and --repository=*<URL> are options. The -s is the MODE, and the '' is an argument. A breakdown of this command follows:

NOTE:

If this special command gives no output, chances are you've pointed to a URL that doesn't exist. Paste the URL into a browser. If it errors out, the URL doesn't exist. If it lists a bunch of files, re-check your command.

This special repo mirror content listing command is important because the usual reason you enable a new subrepo is to get software that's in that subrepo. The special repo mirror content listing, possibly combined with the grep command, can provide that information. Also, if you intend to keep on using Void Linux, this command can help you learn what kinds of packages are in which subrepos.

Finding Appropriate Mirrors

Prominent Void Linux Project member maldridge said "Every byte shipped across the atlantic is a non trivial cost." That's one reason why you should pick a mirror near you.

Another reason is your time. Big updates can take 15 minutes in the best of circumstances. If your update needs to cross the ocean, it could take more than an hour.

Distance isn't the only factor. A close mirror could be slow if it's underpowered or overused. So you'll need to start with close mirrors, but perhaps switch to farther ones (but on your continent) if the closest don't work well.

To find a reasonably up to date list of mirrors, see https://wiki.voidlinux.eu/XBPS#Official_Repositories. Pick a close repo, and make sure it has files in it.

The Debug Problem

The Void project has decided that most people don't need a debug subrepository, so if you need a debug repository, so many mirros lack one. You need to make sure its URL contains files. Browse to the debug directory of your main mirror's to make sure it has files. If not, its not a sin to use the debug subrepo from a different mirror.

Specifying Subrepos

Subrepos are for special repositories such as nonfree, debug, multiarch, and multiarch-nonfree. If you need to install something not in the main repo, such as nonfree software or a debug package, you need to enable the necessary subrepo.

[root@ricardo xbps.d]# xbps-query -Rs void-repo
[-] void-repo-debug-9_1            Void Linux drop-in file for the debug rep...
[-] void-repo-multilib-6_1         Void Linux drop-in file for the multilib ...
[-] void-repo-multilib-nonfree-6_1 Void Linux drop-in file for the multilib/...
[-] void-repo-nonfree-9_1          Void Linux drop-in file for the nonfree r...
[root@ricardo xbps.d]#

If any of the subrepos had already been installed on host "ricardo", an asterisk would have been displayed between the square brackets instead of a hyphen. If you need to install a subrepo, use the xbps-install command. For instance, the following installs the nonfree subrepo:

xbps-install void-repo-nonfree

The preceding command says nothing about which mirror you use: It only installs file 10-repository-nonfree.conf, containing a pointer to the primary nonfree repo, https://repo.voidlinux.eu/current/nonfree in the /usr/share/xbps.d directory. The next section tells you how to override that default.

Specifying Mirrors

If the primary repo or subrepo in /usr/share/xbps.d doesn't suit your needs, because of geography, performance, or other reasons, you can override it in the /etc/xbps.d directory. The procedure is simple:

  1. Copy the file for the (sub)repo from /usr/share/xbps.d to /etc/xbps.d.
  2. Edit the file in /etc/xbps.d, replacing the URL of the mirror you don't want with the URL of the mirror you do want.

[ Training | Troubleshooters.Com | Email Steve Litt ]