Install Unison In CentOS 7

October 23, 2014 16.5k views

Hello I has CentOS 6 and unison installed and worked great and now I am using CentOS 7 and unison does not even exist. I don’t want to install EPEL for CentOS 6 when EPEL exist for CentOS 7. The sad part is EPEL 7 does not have unison.


  • I tried

    rpm -Uvh
    yum update
    yum install unison

    And the package don’t exist.

    As you can see from the repo the Unison don’t exist:

    However it exist for older 6 EPEL

    And I want to avoid using old EPEL if possible.
    I am open to compile from source but having doing that as well.

    unison-2.40.102]# make
    /bin/sh: ocamlc: command not found
    /bin/sh: ocamlc: command not found
    ocamlc -o mkProjectInfo unix.cma str.cma
    make: ocamlc: Command not found
    UISTYLE = text
    Building for Unix
    NATIVE = true
    THREADS = false
    STATIC = false
    OSTYPE =
    OSARCH =
    make tags
    /bin/sh: ocamlc: command not found
    /bin/sh: ocamlc: command not found
    make[1]: Entering directory `/root/unison-2.40.102'
    ocamlc -o mkProjectInfo unix.cma str.cma
    make[1]: ocamlc: Command not found
    if [ -f `which etags` ]; then \
        etags *.mli */*.mli *.ml */*.ml */*.m *.c */*.c *.txt \
              ; fi 
    which: no etags in (/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/www/.local/bin:/home/www/bin)
    /bin/sh: line 1: etags: command not found
    make[1]: [tags] Error 127 (ignored)
    make[1]: Leaving directory `/root/unison-2.40.102'
  • Unfortunately, it doesn’t look like it’s packaged anywhere for CentOS 7 yet. To build it from source, you’ll need to install the ocaml package.

2 Answers

Got it. It works this way.

How to install Unison in CentOS 7
yum install ocaml ocaml-camlp4-devel ctags ctags-etags

cd ~
tar xvfz unison-2.40.102.tar.gz
cd unison-2.40.102

sudo cp -v unison /usr/local/sbin/

cd ~
rm -fr unison*

One more thing.
You also have to place the “unison” binary in the “/usr/bin” folder else you will get this error from the other end server where you installed unison.

Contacting server...
bash: unison: command not found
Fatal error: Lost connection with the server

so do the following

sudo cp -v unison /usr/local/sbin/
sudo cp -v unison /usr/bin
Have another answer? Share your knowledge.