I follow the following commands in order to install Tezos.

  sudo apt-get update \
&& sudo apt-get upgrade \
&& sudo apt install -y rsync git m4 build-essential patch unzip bubblewrap wget pkg-config libgmp-dev libev-dev libhidapi-dev ntp rng-tools\
&& echo "HRNGDEVICE=/dev/urandom" | sudo tee -a /etc/default/rng-tools \
&& /etc/init.d/rng-tools start \
&& wget https://github.com/ocaml/opam/releases/download/2.0.5/opam-2.0.5-x86_64-linux \
&& sudo cp opam-2.0.5-x86_64-linux /usr/local/bin/opam \
&& sudo chmod a+x /usr/local/bin/opam \
&& git clone https://gitlab.com/tezos/tezos.git \
&& cd tezos \
&& git checkout carthagenet \
&& opam init --bare \
&& opam switch create tezos ocaml-base-compiler.4.07.1 \
&& eval $(opam env) \
&& make build-deps \
&& eval $(opam env) \
&& make \
&& ~/tezos/tezos-node identity generate

I have also tried other recipes from the Tezos website or medium articles. When I enter the commands in bash one after another, everything works fine. However, for my research I need to automatically set up larger numbers of nodes from scratch, so I need a fully automatic setup. When I execute a single bash script containing all the above commands, the make command fails. All steps before seem to succeed. When I continue with make manually after the script aborts, everything works as expected. Moreover, when I execute eval $(opam env) && cd tezos && make via ssh, all seems to be fine, however, at a later stage, when I run the sandboxed client, I cannot connect to the sandboxed nodes. When I run make from the terminal before, the sandboxed stuff works out nicely.

Please see below the terminal output before the script fails to execute the make command. All has been repeatedly tested on a fresh installation of Ubuntu 18.04 where only docker has been installed.

Help would be very much appreciated. Thanks!

Terminal output

  • You are aware that 'carthagenet' is the testing network, right?
    – utdrmac
    Mar 12, 2020 at 16:45
  • Yes, ultimately I need an automatic setup of private testnets for my experiments. I have also tried with alphanet before, with the same results. Mar 12, 2020 at 17:50
  • This command opam switch create tezos ocaml-base-compiler.4.07.1, I've never used when compiling tezos. You might also want to try make build-deps && eval $(opam env) && make as a separate one-liner, as that is the typical "rebuild" instruction for new versions.
    – utdrmac
    Mar 13, 2020 at 14:11
  • Thank you very much for the suggestion. Unfortunately, also skipping the switch command did not resolve the issue. Mar 14, 2020 at 14:18

1 Answer 1


By inserting export PATH=/home/ubuntu/tezos/_opam/bin/:$PATH right inbetween eval $(opam env) and make, the issue could be resolved. It seems that in an interactive shell session, the environment is set automatically while it needs to be exported manually within a bash script.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.