You first need to set an environmental variable to LEGATO_ROOT. (Set LEGATO_ROOT to the directory where you installed legato-xx.yy.z).
For setting up environmental variable,
open .profile in your editor. Bash command:
where EDITOR can be any editor such as gedit or vim.
export LEGATO_ROOT=<path to the directory where you have installed legato>
Save and exit.
To check if LEGATO_ROOT is set or not, use bash command: