Brew's package selection is unmatched and it works great for a particular purpose. Keep using it, but stop using your dev machine's system package manager to manage project dependencies. There are a bunch of good reasons not to do that, anyway. For server stuff, probably use Docker. Brew is for your tools you personally use, that you mostly want to be at latest. If a project needs, say, a compiler and library at a specific version, define that in the project and use something that will manage that for you, which will typically be language-specific—damn near every language has an "Xvm" now, where X is the first letter of the language or platform, or else something equivalent, right? That's not to cater to Mac with Brew, it's because that's a very good idea on any platform.
You shouldn't use the system package manager on Ubuntu or Red Hat or whatever the way you're using Brew, either, unless you're exactly matched to your deployment target—same distro, same version, and you don't upgrade locally unless the servers are getting upgraded—and are scripting your local package installations and upgrades with the same script you use to deploy on the server.