How to install Unison 2.48 on Ubuntu

·

For developing on remote servers, but using a local IDE, I prefer to use Unison over other methods that rely on syncing files via rsync or SFTP.

But, one issue with Unison is that two computers must have the same version to sync. And since Homebrew installs Unison 2.48.4 and apt-get install unison installs something like 2.0.x, this meant I couldn’t sync between my computer and a development machine if I wanted to install Unison via apt-get

No worries, by following the documentation, and a bit more searching, I was able to figure out how to build Unison 2.48.4 on my development server!

Note: I did run into a warning at the end of the build. But, from what I can tell, the build actually succeeded. The second-to-last step below helps you test if the build succeeded.

  • apt-get install ocaml
  • apt-get install make
  • curl -O curl -O https://www.seas.upenn.edu/~bcpierce/unison//download/releases/stable/unison-2.48.4.tar.gz
  • tar -xvzf unison-2.48.4.tar.gz
  • cd src
  • make UISTYLE=text
  • ./unison to make sure it built correctly. You should see something like this:
    Usage: unison [options]
    or unison root1 root2 [options]
    or unison profilename [options]
    
    For a list of options, type "unison -help".
    For a tutorial on basic usage, type "unison -doc tutorial".
    For other documentation, type "unison -doc topics".
    
  • mv unison /usr/local/bin

After going through these commands, unison should be in your path, so you should be able to use unison from any directory without specifying the location of the binary.

Comments

6 responses to “How to install Unison 2.48 on Ubuntu”

  1. David Avatar

    Thank you very much for sharing your experience.
    I was struggling to setup the same unison version on my docker container and my mac and your post was really helpful.

  2. Michael Koch Avatar
    Michael Koch

    Thank you very much, Eric.
    I was able to adopt your solution with only slight modifications.
    Now I can run unison synchronizations between my Armbian “powered” server (a NanoPi Neo) an my Archlinux laptops.
    Have a nice day! (.. you saved mine.)

    Michael

  3. Rakesh Avatar

    Hello Eric

    Thanks for your post. I was able to install and run it within minutes. As you mentioned, I do got build errors but can be ignored.

  4. Gabriel Avatar

    Hey Eric. According to you, “one issue with Unison is that two computers must have the same version to sync”. This statement is false. You don’t need to have unison installed at all on the computer you are sync-ing from.
    And why would you? Unison is just an application which syncs folders. So basically connecting to the remote machine to a shared folder, copying data. This is kind of what rsync or scp does.
    All it needs is authorization/permissions.
    So please explain that statement. Maybe I got it wrong. Thank you.

Leave a Reply to Michael KochCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Eric Binnion

Subscribe now to keep reading and get access to the full archive.

Continue reading

Discover more from Eric Binnion

Subscribe now to keep reading and get access to the full archive.

Continue reading