5

On my other computers I have unison version 2.40.102 (this is the latest version available), and on my desktop ubuntu 16.04 xenial I have unison version 2.48.3.

When trying to synchronize:

kayd@Trunk:~$ unison . ssh://pi@mizu/.
...
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".

Various sources tell me to install unison-all, which I did, but it contains only version 2.48:

kayd@Trunk:~$ ls -l /usr/bin/unison*
lrwxrwxrwx 1 root root      24 Mai 20 22:15 /usr/bin/unison -> /etc/alternatives/unison
lrwxrwxrwx 1 root root      13 Mär 18 16:10 /usr/bin/unison-2.48 -> unison-2.48.3
-rwxr-xr-x 1 root root 2169968 Mär 18 16:10 /usr/bin/unison-2.48.3
lrwxrwxrwx 1 root root      13 Mär 18 16:10 /usr/bin/unison-latest-stable -> unison-2.48.3

The my question is:

How can I install version 2.40 on xenial?

kay_D
  • 394

3 Answers3

9

I found a deb file here, which is for trusty, but aparently works anyway, downloaded the 64 bit version and used

sudo dpkg --install ./unison-gtk_2.40.102-2ubuntu1_amd64.deb

to install. Based on ridgy's answer I use unison-2.40-gtk to invoke unison for synching with my RaspberryPis

kay_D
  • 394
2

Yeah, the versions of Unison that you are running have to be identical. This is because the format for the archive file that Unison uses to keep track of stuff is improved changed in each new version.

If you really want to install 2.40 on Xenial, just download the source for Unison, compile it with OCaml, and install it.

Although, I would recommend installing a newer version of Unison on your other computer.

Mike Pierce
  • 292
  • 3
  • 18
2

Today I had the same problem: Server with raspbian (unison 2.40) and two clients (Ubuntu 14.04 / unison 2.40 and Ubuntu 16.04 / unison 2.48).

Because of raspbian, I could not (easily) upgrade to 2.48 on server. But copying the 2.40-binaries from Ubuntu 14.04 to Ubuntu 16.04 did work:

ubu1604# cd /usr/bin; sudo scp -p ubu1404:/usr/bin/unison-2.40.102* .

You may then call unison-2.40.102 direct, or change the links /etc/alternatives/unison* to the respective binaries.

Edit:

After upgrade from 14.04 to 16.04 on my second machine I again had the issue, and getting and installing the .deb file helped, thanks to kay_D.

Changing only the links in /etc/alternatives did not be sufficient, as the repective .desktop file called the unison binary directly. So I changed /usr/share/applications/unison-gtk.desktop

Exec=unison-gtk

(Sometimes i prefer to call programs not from a terminal, but from the menu)

ridgy
  • 2,516