I am using SaltStack to create qubes. I am looking to install some packages from debian 12 experimental. Anyone knows how to install from debian experimental in SaltStack?
Do you want to know how to set up a repository, how to install packages,
or both?
I needed both. But was able to find some answers online.
For anyone interested.
- First enable experimental package in sources.list. I did this using Saltstack’s
file.managed
and pushed a file into/etc/apt/sources.list.d/experimental-debian.list
. It should be fairly easy to find what should be content of this file. - Packages from the experimental repository can be installed be using a parameter
fromrepo: experimental
in Saltstack’spkg.installed
task.
thanks for sharing. What may be more helpful, to those new to salt or also considering downloading packages from experimental repos, would be the full salt state.
Repository
- Set up new repo.
pkgrepo.managed is fully documented
Create a state file, repo.sls:
install_trixie_sources:
pkgrepo.managed:
- humanname: trixie
- name: deb https://deb.debian.org/debian trixie main
- file: /etc/apt/sources.list.d/trixie.list
Apply it with qubesctl --skip-dom0 --targets=TARGET state.apply repo
- Alternative method.
Use file.managed
Create a file containing the content that you want, e.g. trixie_sources:
deb https://deb.debian.org/debian trixie main
Create a state file, repo_managed.sls:
/etc/apt/sources.list.d/trixie.list:
file.managed:
- source: salt://trixie_sources
Apply it with `qubesctl --skip-dom0 --targets=TARGET state.apply repo_managed``
Install Packages
- Use the pkg module
Create a state file, install_edbrowse.sls, explicitly stating repo to
use:
install_edbrowse:
pkg.installed:
- fromrepo: trixie
- name: edbrowse
- refresh: True
- Alternatively, make sure you have latest version:
install_latest_edbrowse:
pkg.latest:
- name: edbrowse
- refresh: True
These are simple examples.
As it is salt, you can use pkg.installed
with templating to cover
cases where the package name differs between distros, manually push
packages stored in dom0, install from repositories set up on the fly,
and so on.
Those are more complex cases, but are fully documented.