You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some apps I need to run as root on the host, for example httm. After installing brew with ujust brew, I am able to install apps into my user directory just fine. But I can't run brew as root, or access an app installed in my user directory as root, which is kind of a catch-22.
So, sudo brew returns sudo: brew: command not found. And if I install say httm as a user, when I try sudo httm I also get command not found. But the command can't be run as a plain user.
What should I do?
The text was updated successfully, but these errors were encountered:
The reason why brew commands are not showing up when using brew applications is due to the fact that sudo does not have the same environment as you.
httm in your case exists at /var/home/linuxbrew/.linuxbrew/bin/httm and when sudo executes something it executes it as a non-login shell. We add the brew path via /etc/profile.d which is only sourced by login shells for bash/zsh (Fish is different but similar idea applies).
You should be able to run your httm command with sudo if you give it the absolute path. You can also use sudo -E to preserve your entire environment (which can be a security issue) or sudo --preserve-env=PATH to specifically preserve your PATH. You also can use sudo -i to start a login shell with root. sudo -i httm may work as well.
For sudo brew, brew doesn't like running as root since that would mean all build scripts would have access to your system. Brew for the most part should only be writing to /var/home/linuxbrew/.linuxbrew which is owned by the user who ran ujust brew
I am running Bazzite with the latest image.
There are some apps I need to run as root on the host, for example httm. After installing brew with ujust brew, I am able to install apps into my user directory just fine. But I can't run brew as root, or access an app installed in my user directory as root, which is kind of a catch-22.
So,
sudo brew
returnssudo: brew: command not found
. And if I install say httm as a user, when I trysudo httm
I also get command not found. But the command can't be run as a plain user.What should I do?
The text was updated successfully, but these errors were encountered: