41

The rsync version on my OS X (10.10.3) is an old one, 2.6.9. I've tried to upgrade it using Homebrew but I get the following error:

Error: No available formula for rsync

The new one is supposed to be 3.0+ and much quicker, but how do I install this without deleting the old one?

  • 2
    You need the dupes formula, but this is off-topic for StackOverflow - try http://apple.stackexchange.com ? – Paul R Jun 15 '15 at 09:48

5 Answers5

60

Follow the instructions here:

brew tap homebrew/dupes
brew install rsync

And then edit /private/etc/paths to put /usr/local/bin before /usr/bin.

Edit:

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

So, only

brew install rsync

is enough.

Mr_Green
  • 36,985
  • 43
  • 143
  • 241
Vaibhav Sagar
  • 2,108
  • 13
  • 20
  • 6
    I got it installed right, and edited my paths correctly but still get rsync --version : 2.6.9 ... any idea why ? (yes, i did restart my terminal) – Vincent Wasteels May 18 '16 at 14:29
  • 1
    @VincentWasteels you can use `which rsync` to view the path to the rsync version that is executing when you call `rsync` or `rsync --version` from the command line. You can then use `echo $PATH` to look at the order of locations in your PATH variable. It is possible that `/usr/bin` is still before `/usr/local/bin` in your path. If so, try examining the contents of the `.bashrc` and `.bash_profile` files to determine where the misordering of directories in your PATH is coming from. – Michael Ohlrogge May 29 '16 at 18:46
  • I experienced the path not initializing as expected but only when doing a remote login to the mac with `ssh`. It was due to how I was connecting (`ssh -t me@mymac caffeinate -i bash`) which started a [non-login shell](http://unix.stackexchange.com/questions/38175). Anyone experiencing problems with the math might want to check their shell - `shopt -q login_shell`. (I suffixed my ssh command with `-l` to fix my problem but that's going off topic a little!) – starfry Jul 22 '16 at 13:12
  • 4
    When using rsync from another machine to connect to your Mac, use `--rsync-path=/usr/local/bin/rsync` so the correct version of the server is used – Elle Mundy Dec 23 '16 at 19:59
  • I went through the steps outlined above but my version of rsync was still stuck at 2.6.9. I checked `.bashrc` and `.bash_profile` for proper paths and things looked correct. Even after opening/closing terminal, the version was still stuck. Finally, I just re-sourced the `/private/etc/paths` file by doing `source /private/etc/paths`. Then checking `rsnych --version` finally showed `3.2.1`. Hope this helps others. – EHerman Jun 04 '17 at 14:31
  • 4
    "Warning: homebrew/dupes was deprecated. This tap is now empty as all its formulae were migrated." – Paulo Almeida Jul 07 '17 at 04:35
  • 8
    rsync now part of homebrew-core. `brew install rsync` now installs without the need for tap. – dave Oct 11 '17 at 21:52
  • @MichaelOhlrogge my ordering seems to be as you suggested but I still can't use it. Look: `/Users/me/miniconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Users/me/bin`. Do you know how to fix it? – Charlie Parker Jun 14 '18 at 16:49
  • 1
    @CharlieParker Just seeing the output that you've given there doesn't reveal that much information. The key is that you want to look in those different directories. My suspicion is that one fo the earlier directories in your list will have an earlier version of rsync. In particular, I'd try checking that very first directory in your list. It's also possible you somehow have a home-brew configuration that is installing in a different directory than `/usr/local/bin` – Michael Ohlrogge Jun 14 '18 at 17:13
  • @MichaelOhlrogge is the issue that my `PATH` has things in an odd order? What is the order that they usually are in mac os X? – Charlie Parker Jun 14 '18 at 17:48
  • 1
    @CharlieParker I'd recommend navigating to the different folders in the path to see if you can identify an earlier version of rsync in them. You can dot hat with the `cd` command in terminal or the go to folder command within Finder. – Michael Ohlrogge Jun 14 '18 at 17:54
  • 1
    @MichaelOhlrogge yea I did check that :p. Anyway, it seems that the version `3.1.3` is on the first one in my path `/usr/local/bin` however, its executing the one in the later one i.e. the one on `/usr/bin` which is version `2.6.9`. Thats rather odd...Do you know whats going on? Or what you'd suggest me to make this work? – Charlie Parker Jun 14 '18 at 17:58
  • 1
    @CharlieParker I'd check for thinks like symlinks in your `/Users/me/...` folder. If still not there, then maybe post / look for a question focused on the issue of the PATH not behaving as expected for order of programs. Or, as a blunt measure, you could delete the rsync version in the undesired location. – Michael Ohlrogge Jun 14 '18 at 18:01
  • @MichaelOhlrogge don't know what fixed it but now that I've updated to a newer version of the OS, tit seems to be using the right version of rsync. – Charlie Parker Jun 14 '18 at 18:28
  • 1
    @CharlieParker Great, glad to hear it. – Michael Ohlrogge Jun 14 '18 at 18:29
14

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

Paulo Almeida
  • 2,010
  • 2
  • 17
  • 19
  • 5
    Good to know. It appears the solution is now that rsync is part of homebrew-core, and thus `brew install rsync` simply works, as expected. – ryanm Dec 27 '17 at 13:14
12

Merged answers of Vaibhav Sagar, Paulo Almeida, woodenflute, Community, the final solution is (just):

brew install rsync

Explanation:

  • NOT need brew tap homebrew/dupes for homebrew/dupes has been deprecated and merged into build-in homebrew/core
    • you can use brew tap to find existing homebrew/core
  • after install, if you are in terminal, you need refresh terminal: source ~/.bashrc, then can use rsync --version to see the new version, otherwise it still show old version
crifan
  • 8,424
  • 1
  • 45
  • 35
  • You are missing the most important step, which is to make sure /usr/local/bin is before /usr/bin for the PATH. If this is not done, merely installing a new version will not necessarily result in it being used by the user! – oemb1905 May 24 '21 at 21:16
2

If you followed @Vaibhav Sagar's instruction, and checked that everything is correct as per @Michael Ohlrogge's comment and it still doesn't work, try reloading bash as per this answer: How do I reload .bashrc without logging out and back in? by executing . ~/.bashrc or exec bash.

Community
  • 1
  • 1
woodenflute
  • 315
  • 2
  • 7
-1

Had the same problem, try to update homebrew

brew update
brew update
brew tap home-brew/dupes
brew install rsync
Oliver
  • 38,725
  • 7
  • 83
  • 136