Homebrew
Install Homebrew (Linuxbrew) for a non-root user on a Debian or Ubuntu system.
homebrew.sh prepares the /home/linuxbrew/.linuxbrew prefix and runs the
official Homebrew installer as a non-root user, because Homebrew refuses to
run as root.
| Run it | As root on the system that should get Homebrew. The script has no Proxmox VE host check |
| Supported OS | Debian or Ubuntu (require_debian_like: Alpine and systems without apt-get exit with code 238) |
| Port | None |
| Source | tools/addon/homebrew.sh |
Run
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/homebrew.sh)"Prompts
| Prompt | Answer |
|---|---|
Install Homebrew? (y/N): | y installs. Anything else exits |
Create a 'brew' user automatically? (y/N): | Only when no regular user exists. y creates the user brew with /bin/bash. Anything else exits with code 254 |
When /home/linuxbrew/.linuxbrew already exists:
| Prompt | Answer |
|---|---|
Uninstall Homebrew? (y/N): | y removes it. Anything else exits with No action selected |
Which user gets Homebrew
The script takes the first entry in /etc/passwd with a UID from 1000 up to
65533 whose shell is not nologin or false. If there is none, it offers to
create brew. You cannot pick a different user in the script.
What it creates
| Item | Value |
|---|---|
| Packages | build-essential, git, file, procps |
| Group | linuxbrew; the chosen user is added to it |
| Prefix | /home/linuxbrew/.linuxbrew, owned by the chosen user, group linuxbrew, mode 2775 |
| Homebrew | Installed by https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh with NONINTERACTIVE=1, run as the chosen user |
| Shell setup | /etc/profile.d/homebrew.sh for login shells, and a # Homebrew (Linuxbrew) block appended to the user's ~/.bashrc and ~/.profile |
No service, port or password is created. The brew user gets no password.
Use it from a login shell of that user. With the automatically created user:
su - brew
brew install <package>Update
The script has no update path and installs no update_ helper. Homebrew
updates itself with brew update.
Remove
Uninstall Homebrew? removes the # Homebrew (Linuxbrew) block from the
user's ~/.bashrc and ~/.profile, deletes /home/linuxbrew and
/etc/profile.d/homebrew.sh and deletes the group linuxbrew.
The user (including an automatically created brew) and the four packages
stay.