We are currently receiving these kind of error messages when updating our tezos node.
Our upgrading procedure are like this: 1. We copy the main ~/tezos directory to a new directory called ~/tezos-new. 2. Call update command as shown below. 3. Stop node, change directory names, and start node again.
Using this command:
cd ~/tezos-new && eval $(opam env) && make clean && git checkout mainnet && git pull && make clean && make build-deps && eval $(opam env) && make && cd ~
We get errors like this:
[ERROR] No switch is currently set. Please use 'opam switch' to set or install a switch
make: dune: Command not found
Makefile:118: recipe for target 'clean' failed
make: [clean] Error 127 (ignored)
make[1]: Entering directory '/home/tezos/tezos-new/docs'
make[1]: Leaving directory '/home/tezos/tezos-new/docs'
Already on 'mainnet'
Your branch is up to date with 'origin/mainnet'.
Already up to date.
[ERROR] No switch is currently set. Please use 'opam switch' to set or install a switch
make: dune: Command not found
Makefile:118: recipe for target 'clean' failed
make: [clean] Error 127 (ignored)
make[1]: Entering directory '/home/tezos/tezos-new/docs'
make[1]: Leaving directory '/home/tezos/tezos-new/docs'
[ERROR] No switch is currently set. Please use 'opam switch' to set or install a switch
[tezos] Initialised
Any insight is much appreciated.
In the end the node is updated, and is running latest block and everything. Just wanted to get more insight into this message. Thanks.
opam init
first in the new directory to initialize opam env and that will also set opam switch_opam
subdirectory in ~/tezos and you try to copy it to ~/tezos-new you may confuse opam (because the _opam directories are not relocatable).