VoidLinux: Updating customized and manually built packages locked to own repository

troubleshooting issues related to package update while it is locked to `master` repository

VoidLinux /#VL/ is just awesome. But this post is not about it.

In VL packages could be installed by invoking xbps-install -S <pkg> or by utilizing xbps-src script found in packages sources repository. This script is used to manually build packages thus meaning one could modify pkg, it sources, patch it, change building options etc. xbps-src is a GNU-Bash script (so please be kind to it).

Fast and dirty way of using xbps-src:
git clone https://github.com/void-linux/void-packages.git
sudo chown -R $USER: void-packages
cd void-packages
# now edit _template_ file located in **srcpkgs/<pkg>/template
# add something meaningfull plz
vim srcpkgs/iwd/template
# now run
./xbps-src pkg iwd  #_iwd_ just an example; gen command is _./xbps-src pkg <pkg-name>_
# built package for installation would live in _hostdir/binpkgs_ folder
# to install run
sudo xbps-install --repository=hostdir/binpkgs -f iwd # _-f_ option is used to force reinstallation if the same version is already installed

Preventing pkg update's overriding

To prevent manually built and installed package from overriding on the next system update (sudo xbps-install -Suy) it has to be locked, or put on hold.

There are two available methods:

  • xbps-pkgdb -m hold <pkg>, it puts package on hold meaning no auto updates for the

  • xbps-pkgdb -m repolock <pkg> meaning that the would only accept updates from the same repository that was used for installing (in our case hostdir/binpkgs)

Special notes

Here comes unpleasant glitch. If you built and installed package from master branch of void-packages, locked it with -m repolock, and after some time decided to build customized packages on own branch (say custom-builds branch), the process will definitely fail. This is because the package is locked to master branch (remember 'same repository that was used for installing'?), and now we are trying to install package from custom-builds branch (in the meantime repository's folder for the custom branch would be hostdir/binpkgs/custom-builds).

In the case the package has to be unlocked. To list locked packages run:

xbps-query --list-repolock-pkgs

Then to unlock your do

sudo xbps-pkgdb -m repounlock <pkg>

And now this package could be installed with xbps-install command.