使用 Homebrew 在 OS X 上升级 rsync

Upgrading rsync on OS X using Homebrew

我的 OS X (10.10.3) 上的 rsync 版本是旧版本,2.6.9。我尝试使用 Homebrew 升级它,但出现以下错误:

Error: No available formula for rsync

新的应该是 3.0+ 并且更快,但是我如何在不删除旧的的情况下安装它?

按照说明进行操作here:

brew tap homebrew/dupes
brew install rsync

然后编辑 /private/etc/paths/usr/local/bin 放在 /usr/bin 之前。

编辑:

Warning: homebrew/dupes was deprecated. This tap is now empty as all its formulae were migrated.

所以,只有

brew install rsync

够了。

如果您按照@Vaibhav Sagar 的说明进行操作,并根据@Michael Ohlrogge 的评论检查了所有内容是否正确,但仍然无法正常工作,请尝试根据此答案重新加载 bash:How do I reload .bashrc without logging out and back in?通过执行 . ~/.bashrcexec bash.

Warning: homebrew/dupes was deprecated. This tap is now empty as all its formulae were migrated.

遇到同样的问题,尝试更新自制软件

brew update
brew update
brew tap home-brew/dupes
brew install rsync

合并Vaibhav SagarPaulo AlmeidawoodenfluteCommunity的答案,最终的解决方案是(只是):

brew install rsync

解释:

  • NOT need brew tap homebrew/dupes for homebrew/dupes 已弃用并合并到内置 homebrew/core
    • 您可以使用 brew tap 查找现有的 homebrew/core
  • 安装后,如果你在终端,你需要刷新终端source ~/.bashrc,然后可以使用rsync --version查看新版本,否则它仍然显示旧版本

按照接受的答案进行操作后,/usr/local/bin中仍然没有rsync二进制文件。

为了最终让它发挥作用,我必须执行以下操作:

sudo ln -s /opt/homebrew/Cellar/rsync/3.2.3/bin/rsync /usr/local/bin/rsync
source ~/.bashrc

在我的例子中,brew install 安装了 rsync 3.2.3 版本。