By default your homebrew installed tools aren’t available in other user, requiring us to do like sudo $(which xyz).
> sudo crictl ps
sudo: crictl: command not found
This guide aims to remedy that.
Procedures
- Add shellenv to your root zshrc/bashrc
# Add one of the following line Apple Silicon: eval "$(/opt/homebrew/bin/brew shellenv)" Intel Mac: eval "$(/usr/local/bin/brew shellenv)" Linux: eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - Edit sudoer with visudo
# Change visudo secure_path Apple Silicon Macs: Add :/opt/homebrew/bin Linux: Add :/home/linuxbrew/.linuxbrew/bin - Viola, tools should be available in root shell/sudo as well.