Resources:
This cheat-sheet uses xi and xdowngrade from xtools.
# Install xtools
> sudo xbps-install -S xtools
# If you have aliased xi, you can still run the command easily
# by using the absolute path of the tool.
# Find out where the program is located:
> whereis xi
xi: /usr/bin/xi
# Use the absolute path to execute the command:
> sudo /usr/bin/xi ...
Cache location: /var/cache/xbps/.
# Find your package with the version you want in the cache.
# I will use neovim as an example.
> ls -l /var/cache/xbps/
[...]
-rw-r--r-- 1 root root 8788988 Mar 30 20:51 neovim-0.12.0_1.x86_64.xbps
[...]
# Downgrade the package using your cached file
> sudo xdowngrade /var/cache/xbps/neovim-0.12.0_1.x86_64.xbps
# Hold the package to ensure it isn't updated automatically with other packages
> sudo xbps-pkgdb -m hold neovim
# To undo this / unhold the package
> sudo xbps-pkgdb -m unhold neovim
# Download the package repository
> git clone https://github.com/void-linux/void-packages.git
# Enter the directory and ensure it's up-to-date
> cd void-packages
> git pull
# Setup a masterdir for xbps-src
> ./xbps-src binary-bootstrap
# To install a package we will use the template file located in
# ./srcpkgs/[package]/template
# Using neovim as an example again:
# ./srcpkgs/neovim/template
# List all commits which have modified that package
> git log --oneline -- ./srcpkgs/neovim/
[...]
d7f0ed368cd neovim: update to 0.12.1
27286e2258e neovim: update to 0.12.0
f6d9f86f31d neovim: update to 0.11.7 # I will use this one
e393872e166 neovim: update to 0.11.6
19a09ac2b17 neovim: update to 0.11.5
[...]
# Revert package directory to a previous commit
> git checkout f6d9f86f31d -- ./srcpkgs/neovim/
# Build package
> ./xbps-src pkg neovim
# Install package
> sudo xi -f neovim
# Hold the package to ensure it isn't updated automatically with other packages
> sudo xbps-pkgdb -m hold neovim
# To undo this / unhold the package
> sudo xbps-pkgdb -m unhold neovim