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
cd
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 &&
 wget http://www.seas.upenn.edu/~bcpierce/unison//download/releases/stable/\
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
make

# Check out the User Manual and Reference Guide here:
# http://www.seas.upenn.edu/~bcpierce/unison//download/releases/stable/unison-manual.html

# Become root to install it
su

# 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
exit

# Save the source for later
cd
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:
cd
su -c "rm -f /usr/local/bin/unison"
exit
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>