Also check out Brew Container
A seperate user that manages homebrew. This would be useful for systems that have multiple users so there would be a user that has the privelege to manage homebrew.
All users can execute programs installed with brew but can't make any changes in the brew directory except for brew user and of course root (which shouldn't be used for homebrew)
Brew should work like normal but executing the command would be a little different. These commands use the sudo password.
-
brewsh
run this to enter a shell in the brew user -
ebrew
execute commands with privleges of the brew user (Now fixed) -
sbrew
runs thebrew
command as brew. Works the same way as the brew command so args and flags would be the same as brew
The brew
command can be used for things that don't require writing data (like listing packages). If you want to install, uninstall, or update packages, The sbrew
command is needed.
Run this in the terminal
curl -s https://raw.githubusercontent.com/dnkmmr69420/brew-user/main/curl.sh | bash
Run this to remove homebrew and its other files
curl -s https://raw.githubusercontent.com/dnkmmr69420/brew-user/main/uninstall.sh | bash
Workaround: Type cd /
to change to a workdir that is readable to the brew user.
I don't even have a mac to test this on so if you do, feel free to fork this and make it compatable with macos