You might enjoy looking into nix and nixos. It’s designed to make that workflow as bulletproof as possible. One of my coworkers maintains a github repo that describes his exact system, and can create a sandbox that behaves the exact same as the one he’s used to with one command (on any machine that has nix installed).