Except dpgk/apt is pretty good about keeping track of what libraries are being used. I've had homebrew upgrade readline to the next major version, uninstalling the version that all my other utilities were linked against. Admittedly, this was years ago and I don't know if that still happens; the experienced has soured me on homebrew and I actively avoid having to run the brew command and risking the same again.