Pacmanfile is a tool that allows to declaratively define which packages you want to have installed via Arch Linux' Pacman, Yay or Paru to include packages from the AUR.
Pacmanfile is available in the AUR.
- Run
paru -S pacmanfile
-
Run
pacmanfile help
to get an overview of the existing commands and flags. -
Run
pacmanfile dump
which dumps your currently explicitly installed packages into a pacmanfile.Alternatively, you can manually create a
pacmanfile.txt
file in your$XDG_CONFIG_HOME/pacmanfile
directory (usually~/.config/pacmanfile
) which contains all the packages you want to have installed. Here's an example:alacritty base git linux linux-firmware zsh
You can split the file up into any number of files that match
pacmanfile*.txt
(e.g.pacmanfile-extra.txt
).You can add comments to pacmanfiles by starting any line with a
#
. -
Run
pacmanfile sync
. This will remove any packages that you have installed which are not listed inpacmanfile*.txt
and install any packages that you have not yet installed but that are listed inpacmanfile*.txt
.
Pacmanfile expects its packages to be installed explicitly. In case it complains about a package not being installed, you need to change that package's installation reason to explicit by running sudo pacman -D --asexplicit PACKAGE_NAME
.
Currently, installing groups with pacmanfile
is not supported. The workaround is to list all the members of the group individually in your file.