Comment by Arnavion

4 days ago

The script builds a list of "expected packages" for the host by unioning the `packages` files in all the roles of the host. Then it enumerates all the packages that are "intentionally installed" (*). If there's a difference, it prints the difference and I add what needs to be added and remove what needs to be removed.

(*): This depends on the package manager:

- For Alpine / postmarketOS it's just the content of `/etc/apk/world`.

- For Debian / Ubuntu it's `apt-mark showmanual`.

- For OpenSUSE it's `zypper search --installed-only` (which includes both intentionally and automatically installed packages) and then subtracting the contents of `/var/lib/zypp/AutoInstalled`.