How To Install Unison on Ubuntu 16.04 LTS

Unison is a GUI and terminal-based tool which allows files and directories to be kept in sync with each other, between different local directories and drives or on a network, which could be on different operating systems. The application is available for Unix operating systems (Linux and Mac OS X) and Windows. Changes can be made on the different places, and Unison will update the machines with the correct versions of files and folders, copying, deleting, renaming or deleting files and directories as necessary.

Unison doesn’t currently work well with USB sticks that are formatted as VFAT (FAT32 FAT16 etc) due to file permissions. You might like to try usbsync for this instead. Or, as a workaround, you may try adding a line like ‘perms = 0’ to your ~/.unison/*.prf file, or running with ‘-perms 0’ option.

Examples of uses

Heres a few scenarios on which Unison would be useful:

  • Justine has a lot of music and would want to back it up to another drive in case her main drive fails. Unison can synchronize any new music she has added on her main hard drive, and will delete any music she has deleted from her main drive.
  • Ryan has a laptop and a desktop computer. He works on both regularly and wants to be able to have his latest work available on the computer he wants to use. Unison will be able to syncronise both computers over the network using SSH so that work he has done on his desktop will appear on his laptop, and when he wants to use his desktop again, he can sync the files so they are updated there.

 

Install Unison on Ubuntu 16.04 LTS

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Unison on a Ubuntu 16.04 (Xenial Xerus) server.

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

sudo apt-get update
sudo apt-get upgrade

Step 2. Installing Unison.

Add the PPA repository to your system, update the local repository index and install the unison package:

sudo add-apt-repository ppa:eugenesan/ppa
sudo apt-get update

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

sudo apt-get install unison

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

root@:wpcademy.com~# 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)

Check the version of Unison:

unison --version

Further Help

man unison

Or

unison --help

Congratulation’s! You have successfully installed Unison. Thanks for using this tutorial for installing Unison on Ubuntu 16.04 LTS (Xenial Xerus) system. For additional help or useful information, we recommend you to check the official Unison web site.

Leave a Reply