ISO image file
https://repo-default.voidlinux.org/live/current/
Change root user shell to BASH
login: root
# chsh
/bin/bash
Add extra repositories
# xbps-install void-repo-nonfree
# xbps-install void-repo-multilib
# xbps-install void-repo-multilib-nonfree
Install essential tools
# xbps-install bash-completion vim screen mc htop nmap
Install cron and enable service
# xbps-install cronie
# ln -s /etc/sv/crond /var/service/
Set up periodic SSD TRIM
# vim /etc/cron.weekly/fstrim
#!/bin/sh
fstrim /
# chmod u+x /etc/cron.weekly/fstrim
Install microcode / firmware
# xbps-install intel-ucode
or
# xbps-install linux-firmware-amd
and then regenerate initramfs for the applicable kernel version
# xbps-reconfigure -f linux6.12
Install niri (Wayland)
# xbps-install niri
Install companion utilities
# xbps-install alacritty fuzzel swaylock swayidle swaybg mako xwayland-satellite
Install desktop toolbar and fonts
# xbps-install Waybar font-awesome6
Note: If Waybar fails to start, make sure PipeWire is running.
Install elogind session management along with D-Bus inter-process communication mechanism and enable both services
# xbps-install elogind
# ln -s /etc/sv/elogind /var/service/
# ln -s /etc/sv/dbus /var/service/
Note: Package dbus gets installed automatically with elogind.
Install sound support
# xbps-install pipewire alsa-pipewire pavucontrol
and if using elogind
# xbps-install wireplumber-elogind
Note: Packages wireplumber (session and policy manager) and pulseaudio-utils get installed automatically along with pipewire. PulseAudio interface is provided by PipeWire (symlink pipewire-pulse -> pipewire).
Install video acceleration (Intel and Nvidia)
# xbps-install mesa-vaapi mesa-vdpau
Install OpenGL support
# xbps-install mesa-dri
Example niri config.kdl ➔ https://github.com/wizetek/niri
X Binary Package System (XBPS)
Search available and installed packages (--repository --search)
# xbps-query -Rs "window manager"
Search only installed packages (--show)
# xbps-query -s vim
or
# xbps-query -Ss vim
(Mode -S is the default for query and can be skipped)
Search using regular expressions
# xbps-query --regex -Rs '^neo.*qt'
Check for updates (--sync --update --dry-run)
# xbps-install -S
# xbps-install -un
or (--memory-sync)
# xbps-install -Mun
Update all packages
# xbps-install -Su
Install a package (sync remote repo index first)
# xbps-install -S Waybar
Note: Package names are case sensitive.
Reinstall a package (--force)
# xbps-install -f vim
Downgrade a package using local cache file (--repository --force)
# xbps-install -R /var/cache/xbps/ -f vim-9.1.1215_3
but first add to local repository the old package version (file must be in cache)
# xbps-rindex -a /var/cache/xbps/vim-9.1.1215_3.xbps
Hold / prevent a package from upgrade (--list-manual-pkgs)
# xbps-pkgdb -m hold vim
and then unhold later
# xbps-pkgdb -m unhold vim
Set package as automatically installed (--automatic)
# xbps-pkgdb -A vim
(Package will become an orphan if no other packages depend on it)
Only download the package without installing (--download-only)
# xbps-install -D ranger
Remove a package
# xbps-remove inxi
and also remove all dependencies (--recursive)
# xbps-remove -R inxi
Remove orphaned packages (--remove-orphans)
# xbps-remove -o
Remove old packages from cache (--clean-cache)
# xbps-remove -O
List all installed packages (--list-pkgs)
# xbps-query -l
List manually installed packages (--list-manual-pkgs)
# xbps-query -m
List packages on hold (--list-hold-pkgs)
# xbps-query -H
List package orphans (--list-orphans)
# xbps-query -O
Show information about installed package
# xbps-query vim
or if not installed
# xbps-query -R gvim
List files installed by a package (--files)
# xbps-query -f vim
Show which installed package owns the file (--ownedby)
# xbps-query --regex -o bin/vim
List package dependencies (--deps)
# xbps-query -x vim
List package reverse dependencies (--revdeps)
# xbps-query -X sed
or if not installed
# xbps-query -R -X awk
List repos (--list-repos)
# xbps-query -L
Reconfigure installed package (--force)
# xbps-reconfigure -f fontconfig
and dependencies (--deps)
# xbps-reconfigure -f -x fontconfig
or full dependency tree
# xbps-reconfigure -f -x --fulldeptree fontconfig
Global options
xbps-install, xbps-query
-n, --dry-run Do not do anything
-y, --yes Do not ask for confirmation
xbps-install, xbps-remove
-f, --force Force reinstall / removal
-v, --verbose Verbose
Update all installed packages (--sync --update)
# xbps-install -Su
If required, update the package manager first
# xbps-install -u xbps
List and remove old kernel versions
# vkpurge list
# vkpurge rm 6.12.11_1
or remove all
# vkpurge rm all
Change package repository mirrors
# xbps-install xmirror
# xmirror
# xbps-install -S
and optionally check
# xbps-query -L
# ls /etc/xbps.d/*repo*
Configure XBPS in xbps.d and set some useful options
# cp /usr/share/xbps.d/xbps.conf /etc/xbps.d/
# vim /etc/xbps.d/xbps.conf
ignorepkg=sudo
preserve=/etc/passwd
preserve=/etc/group
keepconf=true
virtualpkg=doas:opendoas
virtualpkg=waybar:Waybar
How to install doas and remove sudo
# xbps-install opendoas
# vim /etc/xbps.d/xbps.conf
ignorepkg=sudo
# xbps-remove sudo
Note: Package sudo depends on base-system and cannot be removed even with the -f, --force option. It must be added to the ignore list in xbps.conf in order to be removed.
List all alternatives
# xbps-alternatives -l
or only alternatives from a package (e.g. vi, vim)
# xbps-alternatives -l neovim
or match a group (e.g. nvi, vim-common, neovim)
# xbps-alternatives -l -g vi
Set alternatives for a package
# xbps-alternatives -s neovim
or for a group
# xbps-alternatives -g vi -s vim-common
How to change the default initramfs generator – replace dracut kernel hooks with mkinitcpio
# xbps-install mkinitcpio
# xbps-alternatives -l -g initramfs
# xbps-alternatives -s mkinitcpio
# xbps-reconfigure -f linux6.12
(Reconfiguring kernel package forces regeneration of initramfs images)
Install zramen and enable service
# xbps-install zramen
# ln -s /etc/sv/zramen /var/service/
Set the amount of memory (defaults to 25%)
# vim /etc/sv/zramen/conf
export ZRAM_SIZE=50
and also suppress messages on tty1
export ZRAMEN_QUIET=1
Restart service
# sv restart zramen
Suppress kernel messages on tty1
# vim /etc/sysctl.conf
kernel.printk = 3 3 3 3
Helpers for working with XBPS (xtools)
Install xtools
# xbps-install xtools
Install a package directly from .xbps file
# xdowngrade mypackage.xbps
List installed packages by size
# xhog
List installed packages by installation date
# xilog
List installed packages not in repo (-v show version)
# xpkg -D -v
or not from remote repos
# xpkg -L -v
Reverse package search by files (-S clone repo first)
# xlocate -S
# xlocate bin/vi
List programs using outdated libraries after update
# xcheckrestart
Show news messages for packages by installation date
# xnews
Bootstrap a new Void Linux installation and chroot into it
$ mkdir newinstall
# xvoidstrap newinstall/
# xchroot newinstall/
The Void source packages collection (void-packages)
xbps-src tutorial
Note: Some packages are not built and distributed by Void Linux due to large size or legal restrictions. These packages still have their build templates and can be locally built and installed.
Clone the void-packages git repository
$ git clone https://github.com/void-linux/void-packages.git
or update the already existing one
$ cd void-packages
$ git pull
Install the recommended bootstrap packages (inside void-packages directory)
$ ./xbps-src binary-bootstrap
To build packages marked as restricted, modify etc/conf (overrides etc/defaults.conf) in the cloned repository
$ echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
Check which package templates contain restricted=yes
$ grep -rl '^restricted=' srcpkgs/
Build a package – later available in hostdir/binpkgs or hostdir/binpkgs/nonfree
$ ./xbps-src pkg google-chrome
Install the built package (--repository)
# xbps-install -R hostdir/binpkgs/nonfree google-chrome
Lock / prevent the built package from getting replaced by system update
# xbps-pkgdb -m repolock vim
and then unlock later
# xbps-pkgdb -m repounlock vim
Start, stop, restart, reload, status of services
# sv up sshd
# sv down wpa_supplicant
# sv restart chronyd
# sv reload sshd
# sv status sshd
# sv status /var/service/*
List enabled services
# ls /var/service/
List available services
# ls /etc/sv/
Enable service
# ln -s /etc/sv/ntpd /var/service/
Note: /var/service is a symlink to /run/runit/runsvdir/current which is a symlink to /etc/runit/runsvdir/current where current is a symlink to either default or single.
Disable service
# rm /var/service/ntpd
or
# unlink /var/service/ntpd
Prevent service from starting at boot
# touch /etc/sv/sshd/down
Switch runlevel (runit-void package provides single and default)
# runsvchdir single
# runsvchdir default
Suspend to RAM (equivalent to systemd's systemctl suspend)
# zzz