this is the tool i have installed in Ubuntu 18 before the development of legato or yocto:
sudo apt-get install bison build-essential chrpath cifs-utils cmake coreutils curl desktop-file-utils diffstat docbook-utils doxygen fakeroot flex g++ gawk gcc git-core gitk graphviz help2man libgmp3-dev libmpfr-dev libreadline6-dev libsdl-dev libtool libxml2-dev libxml-libxml-perl make m4 ninja-build python-pip python-jinja2 python-pysqlite2 quilt samba scons sed subversion texi2html texinfo unzip wget texinfo chrpath openjdk-8-jdk