xxxxxxxxxx
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
xxxxxxxxxx
cd /opt/homebrew/bin/
PATH=$PATH:/opt/homebrew/bin
cd
touch .zshrc
echo export PATH=$PATH:/opt/homebrew/bin >> .zshrc
source: stackoverflow
xxxxxxxxxx
Adding this to my .zshrc solved the problem on a machine with Apple M1 CPU:
eval $(/opt/homebrew/bin/brew shellenv)