In this short tutorial, We will look into How to install Ocaml on Linux.

OCaml installation contains Code compiler OCaml code and environment for code running.

OCaml provides distribution as packages in Linux machines.

  • Fedora

  • OpenSuSE

  • CentOS The following prerequisites required

  • Linux machine

  • Need root access

  • rpm installer required to install libraries

How to install Ocaml compiler in Linux

To install OCaml on Linux machine, please follow the below steps.

  • First Find out machine distribution, Mine is OpenSuSE
  • Go to link , Download your machine distribution rpm. ocaml-4.14.0-2.2.i586.rpm
  • install using the below command
rpm -i ocaml-4.14.0-2.2.i586.rpm
  • It Installs to OCaml to /usr/bin location
  • Check whether OCaml is installed or not using the below command
ocamlc -v

It prints the version installed 4.14. ocamlc is a Objective caml compiler.

Uninstall OCaml on Linux machine

To uninstall OCaml in Linux, please follow the below steps.

  • Run the below command to know the installed package name
rpm -qa | grep ocaml

It returns the package name, and name of OCaml with the version

-Next step, Uninstall OCaml using the below command

rpm -e ocaml-4.14.0-2.2.i586