Linux HOWTOs

About | Home | Search

HOWTO: unison
Description: File synchronization tool for Unix and Windows
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything

# Unison 2.40.102 (latest "stable")
# ===============
# Prerequisites:
# Objective Caml compiler >= 3.11.2
# Gtk2 libraries (for the GUI version)
# The lablgtk2 OCaml library (for the GUI version)

# Get it
test -f installed/unison-2.40.102.tar.gz &&
 mv -f installed/unison-2.40.102.tar.gz .
test ! -f unison-2.40.102.tar.gz &&

# Extract it
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "unison-*" -exec rm -r {} \;
tar xzvf ~/unison-2.40.102.tar.gz
cd unison-2.40.102
test $UID = 0 && chown -R root:root .

# Build the text-based unison program
# (you can ignore the etags error at the end if you don't have emacs)
make UISTYLE=text

# Check that it runs OK
./unison -help

# Build the GUI version

# Check out the User Manual and Reference Guide here:

# Become root to install it

# Install it somewhere in your $PATH
# Add -s if you want to strip symbol tables to make the binary smaller
install -m 755 unison /usr/local/bin/

# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .

# Become yourself again

# Save the source for later
mkdir -p -m 0700 installed
rm -f installed/unison-*.tar.*
mv unison-2.40.102.tar.gz installed/

# If you ever want to uninstall Unison, this should do it:
su -c "rm -f /usr/local/bin/unison"
find ~/src -maxdepth 1 -type d -name "unison-*" -exec rm -r {} \;
rm -f ~/installed/unison-*.tar.*

Back to the list

Last updated: Wed, 29 Apr 2020 22:04:50 -0400
Jason Englander <jason at englanders dot us>