opam-installer command not found

In this troubleshooting guide we learn how to fix opam-installer command not found error message

Introduction

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

opam-installer: command not found

or when using sudo you get the following error message

sudo: opam-installer: command not found

Solutions to opam-installer: command not found

How To Fix opam-installer: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu opam-installer is provided by opam-installer package.

opam-installer is:

opam-installer is a small utility, part of Opam, that can interpret Opam’s .install files and take the appropriate actions.

OPAM stands for OCaml PAckage Manager. It aims to suit to a vast number of users and use cases, and has unique features:

  • Powerful handling of dependencies: versions constraints, optional dependencies, conflicts, etc.
  • Multiple repositories backends: HTTP, rsync, git
  • Ease to create packages and repositories
  • Ability to switch between different compiler versions

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

sudo apt-get -y install opam-installer

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

You can also use apt command to install opam-installer.

sudo apt -y install opam-installer

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

sudo aptitude install opam-installer

Summary

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