Comment by jonotime

Comment by jonotime 3 days ago

1 reply

How do you deal with removing a package? For examplet the case where you have htop in your config, but no longer want it on your system or in your configs.

Arnavion 3 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`.