Installing older package in HomeBrew

mihalis's picture

As I am using unison and a Linux machine for backing up my files, unison is very important to me. After Homebrew updated unison, I got the following error message:

$ unison articles
Contacting server...
mtsouk@linode's password:
Fatal error: Received unexpected header from the server:
expected "Unison 2.48\n" but received "Unison 2.40\n\000\000\000\000\017",
which differs at "Unison 2.40".
This can happen because you have different versions of Unison
installed on the client and server machines, or because
your connection is failing and somebody is printing an error
message, or because your remote login shell is printing
something itself before starting Unison.

The solution to the problem was using the older version of unison. This can be done as follows:


$ brew tap homebrew/boneyard
Cloning into '/usr/local/Library/Taps/homebrew/homebrew-boneyard'...
remote: Counting objects: 723, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 723 (delta 2), reused 1 (delta 0)
Receiving objects: 100% (723/723), 174.67 KiB | 100.00 KiB/s, done.
Resolving deltas: 100% (338/338), done.
Checking connectivity... done.
Tapped 68 formulae
$ cd /usr/local/Library/
$ brew versions unison
Warning: brew-versions is unsupported and will be removed soon.
You should use the homebrew-versions tap instead:
https://github.com/Homebrew/homebrew-versions


2.48.3 git checkout 9eac7e1 /usr/local/Library/Formula/unison.rb
2.40.102 git checkout 3ceb6b0 /usr/local/Library/Formula/unison.rb
2.40.63 git checkout 3c5ca25 /usr/local/Library/Formula/unison.rb
2.40.61 git checkout 5e494c2 /usr/local/Library/Formula/unison.rb
2.32.52 git checkout f724ba8 /usr/local/Library/Formula/unison.rb
MacBook:Library mtsouk$ brew uninstall unison
Uninstalling /usr/local/Cellar/unison/2.48.3...

Last, you install the older unison package:

$ brew uninstall unison
Uninstalling /usr/local/Cellar/unison/2.48.3...
MacBook:Library mtsouk$ pwd
/usr/local/Library
MacBook:Library mtsouk$ git checkout 3ceb6b0 /usr/local/Library/Formula/unison.rb
MacBook:Library mtsouk$ brew install unison
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/unison-2.40.102.yosem
######################################################################## 100.0%
==> Pouring unison-2.40.102.yosemite.bottle.1.tar.gz
/usr/local/Cellar/unison/2.40.102: 6 files, 3.1M

Also found this: http://www.spotwise.com/2015/01/06/broken-unison-brew-on-yosemite/