In this short tutorial, We will look into How to install and uninstall Ocaml on Ubuntu

OCaml installation contains Code compiler and environment for code running.

OCaml provides distribution as packages in Ubuntu machines

The following prerequisites required

  • Ubuntu machine
  • Need root access
  • apt or apt-get installer required to install packages

How to install Ocaml in Ubuntu

To install OCaml on Ubuntu machine, please follow the below steps

  • First, Update existing packages to latest
apt-get update
  • install using the below command
apt-get install ocaml -y
  • 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

Now, Ocaml is installed on your Ubuntu machine. You are ready to code programs in Objective Caml ocamlc is a Objective caml compiler.

Uninstall OCaml in ubuntu machine

To uninstall OCaml in ubuntu, please follow the below steps

  • Run the below command to know the installed package name
apt-get remove ocaml -y
apt autoremove -y