6

I have two machines. One with unison v. 2.40 (Debian Jessie) and a new one (Debian Stretch) where I installed package unison-all, which brought in unison versions 2.32, 2.40 and 2.48. However, I was unable to make my 2.40 work against the new machine, since it only presented v. 2.48. No matter what I do, I get:

expected "Unison 2.40\n" but received "Unison 2.48\n\000\000\000\000\017",

I worked around the issue by removing unison-all and installing v. 2.40 explicitly, but I wonder what to do if I ever want to use two concurrent versions of unison on this machine.

Frigo
  • 222
  • 3
  • 8
  • 1
    I have the same issue, but can not fix it the way you mentioned. If I install the package unison-all on Stretch it only installs 2.48. See [https://lists.debian.org/debian-user/2017/12/msg00425.html] "Since stretch only has 2.40 (corrected the typo) in its repo, it can only pull that one in." I also tried to install unison 2.48 on Debian Jessie [http://forums.debian.net/viewtopic.php?f=10&t=134431], but this overwrites unison 2.40 which I still need for syncs with other servers. How did you manage to get unison 2.32, 2.40 and 2.48 on Debian Stretch? This is what I need! – lihume May 18 '18 at 05:35
  • I'm looking at my deployment but it looks as described above. I have package `unison-all`, it depends on `unison`, `unison2.40.102` and `unison2.32.52`. `apt-cache policy unison-all` tells me that my version is `2.48+2` and that I'm using `stretch/main amd64 Packages`. I'm sorry but I cannot confirm that Stretch only has unison 2.48. I still see all three versions on offer. – Frigo May 22 '18 at 12:23
  • Too late to help most people, but I can report that, for the **Wheezy** to **Jessie** upgrade, the **Jessie** version of Unison was **2.40.102-2** and the **Wheezy** version was **2.40.65-2**. As such, the standard `unison` package sufficed for syncs done between a **Jessie** client and a **Wheezy** server. – Digger Sep 22 '20 at 18:44
  • Again, too late to help most people, but I also report that, when I had the **Stretch** version of **unison** loaded on the client and the **Jessie** version of **unison** loaded on the server, I was able to replace said **Jessie** version with the **Stretch** version (from the standard **Debian Stretch LTS** repo). Even though said server was rocking **Jessie**, this scheme worked just fine...YMMV, of course... – Digger Dec 14 '21 at 23:45

1 Answers1

7

I just ran into this problem myself, and it took quite a bit of searching to find the answer! So here it is, and it works for me.

To use multiple versions of unison, install unison-all. Then...

Using multiple versions of Unison on the client

Choose a specific version to run by appending the version number, like so:

unison-2.40 ...

Or, if you want to run the latest version, you can simply type:

unison

Using multiple versions of Unison on the server

Instruct the client version of Unison to invoke the matching version of Unison on the server using the -addversionno tag, like so:

unison -addversionno

For futher details

and if you still get an

Fatal error: Received unexpected header from the server

see this solution.

Frank Breitling
  • 959
  • 3
  • 12
  • 25
mhwombat
  • 258
  • 2
  • 8
  • Hi! Thanks for dropping a note. However, I think your setup is the opposite of mine. I have multiple versions of unison on the **remote** machine and a single one on my **local** machine where I run the command. So locally I have nothing to chose from. I tried, of course, but the behavior is the same as before. – Frigo Nov 16 '15 at 10:43
  • Youre right, I have the opposite setup. In your case: I see that the unison man page lists an advanced option ` -addversionno` that adds the version number to name of unison on server. Sounds like that might be what you need? – mhwombat Nov 16 '15 at 20:32
  • 1
    Yes! This (-addversionno) is the solution I was looking for. Thanks! I really could not find that. Are you going to expand your answer with that so that I can upvote and accept it? – Frigo Nov 18 '15 at 09:58
  • Done! Glad that helped. – mhwombat Nov 18 '15 at 10:43