Dune: Command 'dune' not found, but can be installed with

Created on 3 Feb 2019  路  5Comments  路  Source: ocaml/dune

I installed dune with both

opam install dune

and

make release
make install

from the dune git repository

However, as I tried the Quickstart of dune, I encountered the following problem

Command 'dune' not found, but can be installed with:

sudo apt install whitedune

when trying the following command

$ dune build hello_world.exe

I had this problem in both Ubuntu 16.04 LTS and 18.04. I am using Ocaml 4.05.0. Opam 1.2.2, and dune 1.2.1. I am sure dune has been successfully installed but my system could not find it.

I am pretty new to opam and dune, any hint to this problem is very appreciated.

Most helpful comment

after you install opam, you need to run eval $(opam config env) to add the right PATH. Once you do that, you should be able to access the binaries installed by opam, such as dune

All 5 comments

after you install opam, you need to run eval $(opam config env) to add the right PATH. Once you do that, you should be able to access the binaries installed by opam, such as dune

Great, that solved the problem!

Thank you very much. Will close the issue.

In order to add dune and other packages' path installed through Opam to the $PATH permanently, add this line to ~/.profile and restart your system

PATH="$HOME/.opam/system/bin:$PATH"

Could we put this in the documentation after the installation instructions?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bobzhang picture bobzhang  路  7Comments

vsiles picture vsiles  路  7Comments

bobbypriambodo picture bobbypriambodo  路  5Comments

jvillard picture jvillard  路  8Comments

anton-trunov picture anton-trunov  路  3Comments