How to install Unison on Ubuntu 16.04

To install Unison on Ubuntu 16.04

Unison is an cross-platform, open-source file synchronization software that permits the users to store the copies of files and folders on two different hosts. When two files are merged with each other, the difference gets copied from one replica to another. This article explains the installation of Unison on Ubuntu.

Features:

  • On contrary to simple mirroring or backup utilities, Unison can deal with updates to both replicas of a distributed directory structure. Updates that do not conflict are propagated automatically, where else conflicting updates are detected and displayed.
  • Unlike a distributed filesystem, Unison is a user-level program(i.e) It doesn' t require kernel update.
  • Unison works between any pair of machines connected to the internet, communicating over either a direct socket link or tunneling over an encrypted ssh connection. It is careful with network bandwidth, and runs well over slow links such as PPP connections. Transfers of small updates to large files are optimized using a compression protocol similar to rsync.
  • Unison is not prone to failure. The replicas are bound to stay intact even in case of abnormal termination or communication failures.
  • Unison has a clear and precise specification.

Installing Unison

Initiate the Unison installation by adding the repository via ppa.

root@linuxhelpubnt:~# add-apt-repository ppa:eugenesan/ppa
 This repository contains collection of customized, updated, ported and backported
packages for two last LTS releases and latest pre-LTS release.
Packages for older releases relocated to ppa:eugenesan/archive or deleted.

+-------------------------------------------------------------------------------------+
| Disclaimer:
+-------------------------------------------------------------------------------------+
* Packages in this a nd related PPAs are for personal use only.
  They developed specifically for several custom environments and may not work for you.
* Usage of packages in this PPA, in some forms, might contradict licenses of software
  packaged in this and related PPAs. End users and administrator are responsible for
  runtime licensing and possible legal consequences.
.
.
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK

Once it is done, use the following command to update the apt sources-list.

root@linuxhelpubnt:~# apt-get update
Hit:1 http://in.archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://ppa.launchpad.net/eugenesan/ppa/ubuntu xenial InRelease [17.5 kB]
Hit:3 http://in.archive.ubuntu.com/ubuntu xenial-updates InRelease                  
Hit:4 http://in.archive.ubuntu.com/ubuntu xenial-backports InRelease                
Get:5 http://ppa.launchpad.net/eugenesan/ppa/ubuntu xenial/main amd64 Packages [39.5 kB]
Get:6 http://ppa.launchpad.net/eugenesan/ppa/ubuntu xenial/main i386 Packages [39.5 kB]
Get:7 http://ppa.launchpad.net/eugenesan/ppa/ubuntu xenial/main Translation-en [24.0 kB]
Fetched 120 kB in 2s (44.3 kB/s)                            
Reading package lists... Done

After updating the apt sources-list, run the following command to install the package.

root@linuxhelpubnt:~# apt-get install unison
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libpango1.0-0 libpangox-1.0-0
Use ' sudo apt autoremove'  to remove them.
Suggested packages:
  unison-all
The following NEW packages will be installed:
  unison
.
.
Setting up unison (2.48.4-0~eugenesan~xenial1) ...
update-alternatives: using /usr/bin/unison-latest-stable to provide /usr/bin/unison (unison) in auto mode

Once it is done, use the following command to view the Basic and Advanced options.

root@linuxhelpubnt:~# unison -help
Usage: unison [options]
    or unison root1 root2 [options]
    or unison profilename [options]

Basic options: 
 -auto              automatically accept default (nonconflicting) actions
 -batch             batch mode: ask no questions at all
 -doc xxx           show documentation (' -doc topics'  lists topics)
 -fat               use appropriate options for FAT filesystems
 -group             synchronize group attributes
 -ignore xxx        add a pattern to the ignore list
 -ignorenot xxx     add a pattern to the ignorenot list
.
.
watch             when set, use a file watcher process to detect changes (default true)
 -xferbycopying     optimize transfers using local copies (default true)

To check the version of Unison, run the following command.

root@linuxhelpubnt:~# unison --version
unison version 2.48.4
Tag : Ubuntu
FAQ
Q
What language is used to write the Unison?
A
Here, Written in “Objective Caml” programming Language for Unison.
Q
What are the mail features of the Unison?
A
A good File Synchronizer is supposed to have below listed Features:

Cryptographic synchronization, as a security Implementation.
A good ratio of data compression.
Q
It is possible to enable the automatic sync?
A
Yes, But the Scheduled Synchronisation is available to sync the files.
Q
What algorithm is used in the Unison?
A
rsync algorithm is deployed here, only the modified part is transferred and overwritten. Hence. it’s fast in execution and Maintenance.
Q
Mention some of the alternatives for Unison?
A
There are so many alternatives
FreeFileSync, Resilio Sync, grsync