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.

  • 2
    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 [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 [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
    Commented May 18, 2018 at 5: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
    Commented May 22, 2018 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
    Commented Sep 22, 2020 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
    Commented Dec 14, 2021 at 23:45
  • 1
    @Digger There are static releases for Unison, which are much easier than juggling with Deb packages on different servers. Unison is a cool project, I'm happy to have found a solution. Commented Mar 16 at 14:09

2 Answers 2


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:


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.

  • 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
    Commented Nov 16, 2015 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
    Commented Nov 16, 2015 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
    Commented Nov 18, 2015 at 9:58
  • Done! Glad that helped.
    – mhwombat
    Commented Nov 18, 2015 at 10:43
  • unison-all sadly doesn't help when there's only one available unison version per system, which seems to be the case for most systems. Commented Mar 9 at 21:28

It's much easier to install static Unison releases, than to hope that every client and server will have the exact same system version.

I deleted unison Debian package from every system, and launched the exact same script everywhere:

set -e

mkdir /tmp/unison
cd /tmp/unison
curl -LO https://github.com/bcpierce00/unison/releases/download/v2.53.4/unison-2.53.4-ubuntu-x86_64-static.tar.gz
tar xvfz unison-2.53*
cd bin
chmod 755 unison unison-fsmonitor
sudo chown root:root unison unison-fsmonitor
sudo mv unison unison-fsmonitor /usr/local/bin/
cd /tmp/
rm -r unison
unison -version

Every client and server can talk together now, because they agree on:

❯ unison -version
unison version 2.53.4 (ocaml 4.14.1)

No issue with libc, ocaml or holding packages anymore! And I can use a recent Unison version even on old servers.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .