Declarative package management for OpenSUSE's zypper.
List the packages you want to keep in one or more files named something.keep in the ~/.config/zyppkeeper directory. Each of these files should contain a list of package names, one per line. You can format the files nicely: whitespace is ignored, and lines beginning with # are treated as comments.
To start our, you'll want an initial idea of what zypper thinks you installed explicitly. Before running any other zyppkeeper commands, run this to output a good guess:
zyppkeeper init
Some packages that are declared may not be installed on your system yet. To fix that:
zyppkeeper install
Some packages may be installed, but not declared. These should either be removed, or added to a .keep file. To list the top-level unneeded packages:
zyppkeeper unneeded
To actually remove all unneeded packages, including their dependencies:
zyppkeeper clean
It's just a Ruby script. Put it somewhere in your PATH.
Then try running zyppkeeper unneeded to output a guess at an initial set of keepers.
Zyppkeeper considers a package needed if it is declared explicitly, or if it is pulled in by another needed package. This can be done via an RPM Depends specifier, or via a Recommends/Enhances specifiers (if zypper is configured to use them).
Zyppkeeper needs to modify the file /var/lib/zypp/AutoInstalled to update zypper's idea of what was requested explicitly. This means commands will generally require sudo. Every time this file is modified, zyppkeeper will backup the previous version with a .bak extension.
- debfoster for apt-based distros (Debian, Ubuntu, etc)
- pacdef for Arch-based distros
- pacmanfile, also for Arch-based distros
- The tab and autoremove subcommands of Homebrew
- The set -A and autoremove subcommands of FreeBSD's pkg
- The selected set of Gentoo's Portage, along with the
--select,--deselectand--depcleanoptions. - The mark and autoremove subcommands of Fedora's dnf
- Of course, the declarative systems of Nix and Guix
Also some obsolete previous attempts of mine at this sort of thing:
- brewfoster for Homebrew
- rpmkeeper and yumkeeper for yum-based distros