如何一起使用 macports 和 homebrew 包管理系统?

发布于 2024-12-27 02:44:13 字数 49 浏览 6 评论 0原文

如何同时使用 macports 和 homebrew 包管理系统而不让它们互相干扰?

How to use macports and homebrew package management systems together without having them interfere with each other in bad ways?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

流云如水 2025-01-03 02:44:13

最好只使用一个包管理器并卸载其他包管理器。例如,如果您想使用 MacPorts,但您需要的程序不在 MacPorts 中,请考虑提交 MacPorts 端口请求票

如果您坚持必须安装多个包管理器,那么请将它们全部安装在非标准前缀中。 MacPorts 的默认前缀是/opt/local。 Homebrew 默认位于 /usr/local。 Fink 使用 /sw。手动从源构建每个包管理器,为每个包选择一个不同于前面所有默认路径的唯一安装前缀。这是为了确保对这些包管理器的默认路径进行硬编码的软件包不会无意中找到来自错误包管理器的依赖项。

当您使用 MacPorts 安装端口时,它会清除大多数环境变量;这是为了确保,即使您在 $PATH 中有 /usr/local/bin 和 /sw/bin,MacPorts 也不会在那里找到东西。我不知道Homebrew和Fink是否也这样做;如果没有,请在使用 Homebrew 或 Fink 安装任何内容之前更改您的 $PATH ,使其不包含具有潜在第三方依赖项的位置。

It's best to use just a single package manager and uninstall the others. If, for example, you want to use MacPorts, but there's a program you need that's not in MacPorts, consider filing a MacPorts port request ticket.

If you insist that you must install multiple package managers, then please install all of them in nonstandard prefixes. MacPorts' default prefix is /opt/local. Homebrew defaults to /usr/local. Fink uses /sw. Build each package manager from source manually, selecting a unique install prefix for each that is different from all of the preceding default paths. This is to ensure that software packages that have hardcoded knowledge of these package managers' default paths do not inadvertently find dependencies from the wrong package manager.

When you install a port with MacPorts, it clears most environment variables; this is to ensure that, even if you have, say, /usr/local/bin and /sw/bin in $PATH, MacPorts will not find things there. I don't know whether Homebrew and Fink do this too; if they don't, change your $PATH so that it doesn't contain locations with potential third-party dependencies, before you install anything using Homebrew or Fink.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文