Can I install Unison for Ubuntu 18.04 LTS on Ubuntu 20.04 LTS?

I think a better solution is

  1. Purge the current installation
  2. Install the former Debian version on the Ubuntu 20.04 LTS server:
wget http://ftp.fr.debian.org/debian/pool/main/u/unison/unison_2.48.4-1+b1_amd64.deb
sudo dpkg -i unison_2.48.4-1+b1_amd64.deb
wget http://ftp.fr.debian.org/debian/pool/main/u/unison/unison-gtk_2.48.4-1+b1_amd64.deb
sudo dpkg -i unison-gtk_2.48.4-1+b1_amd64.deb

Then set them on hold aptitude hold unison unison-gtk. Follow https://bugs.launchpad.net/ubuntu/+source/unison/+bug/1875475 to see when it will be fixed.


I've discovered the hard way what apparently is common knowledge: Unison is extremely picky about not only the version number of the tool itself, but also the OCaml compiler used to compile it. It looks like the team that put together the binaries for Ubuntu 20.04 LTS recompiled with a newer version of the OCaml compiler than what was previously used, without thinking about backwards and cross-platform compatibility is the main feature of syncing tool. IMHO, that's a major goof-up.

The way I fixed this was to first purge unison on Ubuntu 20.04 LTS via apt and then reinstalling it "by hand" by using the static file unison-2.48.4-linux-i386-text-static.tar.gzthat can be downloaded from: https://www.urs-mueller.ch/de/computer/index.html.

I am not an Ubuntu wizard, so I don't know if that is the correct way to go about this, but it works for me and allows me to sync between all my computers again.


Another solution, better in the long run IMHO, especially if you are synchronizing only linux machines, would be to install the snap version of Unison.

This version of Unison is system independent and whatever version of Ubuntu, Debian, etc. you install it on, it is always compiled against the same OCaml. So you don't have to worry about these issues every time something changes in Unison or OCaml. Currently, Unison is at 2.51.2 and OCaml 4.02.3

See this:

https://unix.stackexchange.com/questions/583058/unison-and-version-compiler-conflicts/583377#583377

Remember that you must install snapd first if you are not using Ubuntu:

sudo apt update
sudo apt install snapd

Log out and back in again, or restart your system, to ensure snap’s paths are updated correctly before proceeding.

Then, follow the steps showed in either the link above or this one:

http://www.xente.mundo-r.com/zasjls/other/20/unison_en.html

Tags:

Sync

Unison