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.
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?
Please have a look at https://github.com/ocaml/dune/pull/3310
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 asdune