def _remove_old(env, config_file):
    brew_cmd = os.path.join(env.system_install, "bin", "brew")
    if env.safe_exists(brew_cmd):
        baseline = ["pkg-config", "openssl", "cmake", "unzip", "curl"]
        with open(config_file) as in_handle:
            to_remove = yaml.load(in_handle).get("to_remove", [])
        for pkg_str in baseline + to_remove:
            _safe_uninstall_pkg(env, pkg_str, brew_cmd)
Temporary approach to remove an old brew install migrated to conda packages.
dataset/ETHPy150Open chapmanb/cloudbiolinux/cloudbio/package/brew.py/_remove_old