I only made that mistake a couple of times. Also, back in the early 2000's.I used to HATE chasing down rpm dependencies in the early 2000s when using Red Hat,
The trick is basically don't install anything not specifically compiled for your distro. If it is, then you'll basically be guaranteed that its dependencies will be in the repos and everything in the official repos is pretty much mutually compatible.Ubuntu and other Debian based have apt, like you said, but I've actually managed to hose more ubuntu installs with apt than I have with dnf and Fedora. Actually, I don't think I've killed a single Fedora install.
It's when you can't get something precompiled for your repo (and snap/flatpak/appimage also aren't provided), that you might need to resort to building it. However, if/when you do, either:
- Don't install it in
/usr/
, but instead make a subdir for it, in/opt/
. - Make a package and install that, via your package manager. This will keep the dependencies straight and make it easy to uninstall. However, if it doesn't already have a spec file for your flavor of distro, then just go with option #1.