Using dave
dave is joe Linux's package manager. It installs and removes packages at once, upgrades the whole system as it shuts down, and can always go back.
Everyday commands
Run them with sudo, except those that only look:
| Command | What it does |
|---|---|
dave install NAME... |
Installs packages now. The system as it was is kept first, as a deployment you can start. |
dave remove NAME... |
Removes packages now, after keeping the system as it was in the same way. |
dave upgrade |
Prepares an upgrade of everything. It is applied as the machine shuts down. |
dave upgrade --reboot |
The same, and restarts at once to apply it. |
dave rollback |
The previous system starts on the next boot, and on every boot after it. |
dave status |
What is running, what will start next, and what is pending. |
dave upgrade --check |
Says what an upgrade would change, without preparing it. |
dave search WORD... |
Searches the repositories by name and description. |
dave info NAME |
Describes a package, installed or not: its version, size, licence and dependencies. |
dave list |
Lists what is installed; --requested lists only what you asked for. |
dave files NAME |
Lists the files of an installed package. |
dave owns PATH |
Names the package a file belongs to. |
dave why NAME |
Says why a package is installed: the chain from something you asked for. |
dave help COMMAND |
Explains a command. man dave explains them all. |
--dry-run shows what any of them would do, and stops. Before an install or a removal that changes more than the packages you named (dependencies coming in, other packages upgraded or removed), dave shows the whole plan with its sizes and asks Continue? [Y/n]; -y answers yes. Commands, options and package names complete with Tab in bash, zsh and fish.
What you asked for
The packages you asked for are listed in /etc/dave/world, one per line, each with a version constraint if you gave one. It is the only statement of what the system should contain: everything else installed is there because something in it depends on it. dave install adds to it and dave remove takes away; an upgrade solves it again against the newest repository.
When that cannot be done, dave says why, rather than printing a conflict:
$ sudo dave install editor
dave: this cannot be done.
Because editor 1.0-r1 depends on libui >=2 and editor has no version other than 1.0-r1, editor requires libui >=2.
And because no version of libui matches >=2, editor cannot be installed.
So, because you asked for editor, what you asked for cannot be installed.
Upgrading
dave upgrade works out the upgrade, downloads it and proves it applies cleanly to a copy of the system. It changes nothing you can see. The upgrade is applied as the machine shuts down, to a snapshot of the system as it is at that moment, so nothing you change in between is lost. The next start runs the new system.
If the new system does not start properly three times, the machine goes back to the one before by itself. How upgrades work explains how.
The kernel changes only through dave upgrade, never on the running system.
Going back
dave rollback makes the previous system the one that starts, from the next boot on. It is the same operation as choosing an upgrade, in the other direction, so it lasts until you choose again.
Accounts live in /etc, which belongs to each system. If someone was given an account after the system you are going back to was made, dave says so: that account will not exist there.
Deployments
Every state the system can start in is a deployment: one btrfs snapshot, with its own boot entry.
| Command | What it does |
|---|---|
dave deployments |
Lists them. |
dave deployments pin ID |
Keeps one until it is unpinned. |
dave deployments unpin ID |
Lets it go again. |
dave deployments gc |
Deletes the ones that are no longer needed. |
Servers
Installing a server does not start it. Optional servers are off on a new system; after configuring one, turn it on with:
$ sudo systemctl enable --now UNIT
Repositories
Repositories are listed in /etc/dave/repos.zon, and the keys their indexes are signed with are in /etc/dave/keys/. An installed system uses joe Linux’s own:
// /etc/dave/repos.zon
.{ .repos = .{ .{ .name = "joe", .url = "https://joelinux.io/x86_64" } } }
Packages and repositories describes what is in them and how they are trusted.