ocaml command not found

In this troubleshooting guide we learn how to fix ocaml command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

ocaml: command not found

or when using sudo you get the following error message

sudo: ocaml: command not found

Solutions to ocaml: command not found

How To Fix ocaml: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu ocaml is provided by ocaml-interp package.

ocaml-interp is:

Objective Caml (OCaml) is an implementation of the ML language, based on the Caml Light dialect extended with a complete class-based object system and a powerful module system in the style of Standard ML.

This package contains the files required to run an OCaml shell from the command line.

To fix this problem, we can install more using the command below.

sudo apt-get -y install ocaml-interp

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install ocaml-interp.

sudo apt -y install ocaml-interp

Or if you have aptitude installed you can use the following command.

sudo aptitude install ocaml-interp

Summary

In this tutorial we learn how to fix ocaml command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.