How can I set $PATH so I can sudo brew commands?

I removed mc and htop as rpm-ostree layers and installed them for brew.
If I sudo them I get command not found unless I include the full path.
https://discord.com/channels/1072614816579063828/1087140957096517672/1358084893824909554

If I change to the root user with sudo -i, it is in the path and I can run it just fine.
root@fedora:~# echo $PATH
/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/lib/snapd/snap/bin:/var/home/linuxbrew/.linuxbrew/bin/

:dispair:
Solution
GitHub
What's a reasonable way to use sudo together with utilities, installed via brew? I've installed and successfully using command-line utilities via brew on Kubuntu 22.04.1 Sometimes, I need t...
Was this page helpful?