Silverblue is great for stability, but layering every little CLI tool with rpm-ostree means a reboot each time (the reboot tax). Homebrew (Linuxbrew) fixes that. It installs into your user directory (or the linuxbrew prefix under /home), so the base OS stays clean and there’s no reboot.
I use it so gh, toolchains and one-off CLIs never touch the ostree. For VMs, layer QEMU instead: Setting Up Virtualization on Fedora Silverblue. For an immutable server, I use CoreOS + Quadlets, not Homebrew: Beginner’s Guide to Fedora CoreOS.
When Homebrew is the right layer (and when it is not)
Use brew for: CLI tools you update often, language version managers, tools that are newer in Homebrew than in Fedora’s repos, and experiments you can remove with brew uninstall.
Don’t use brew for: kernel modules, libvirt/qemu, GPU drivers, or anything that runs as a system service at boot. Those belong in rpm-ostree, a privileged container, or a VM.
Never sudo brew. The installer will tell you this too.
Prerequisites
- Fedora Silverblue (the
/var/homelayout has been around for years). - A user with sudo for the one ostree layer (
gcc,make). - Network access to GitHub.
- Git is already in the Silverblue base image. Don’t layer
git/git-corejust because the Linuxbrew docs say so.
Check that you’re on Silverblue:
cat /usr/lib/os-release | grep -E 'VARIANT|NAME'ls -ld /home /var/home/home should be a symlink to /var/home. That’s why copy-pasted Ubuntu brew PATH lines sometimes don’t work.
Step 1: Install the compile dependencies
Brew needs gcc and make to compile packages when there’s no prebuilt binary.
Fedora’s docs also say to install git-core, but Silverblue already includes Git. Installing it throws a conflict error.
Layer only what you need:
rpm-ostree install gcc makeostree downloads, then says “Changes queued… reboot.” Check:
rpm-ostree statusThe pending deployment should list gcc and make. Then reboot:
systemctl rebootAfter the reboot, make sure the compilers are on the host (not just in a toolbox):
command -v gcc makegcc --versionIf gcc is missing, you’re still on the old deployment (rpm-ostree status shows it) or you layered into a toolbox by mistake. Trust command -v over the installer’s messages.
Variant: Toolbox / Distrobox instead of layering gcc
You can compile in a Fedora toolbox instead, but you’ll fight paths. I layer gcc and make once and forget about them.
Step 2: Run the official Homebrew installer
After the reboot, run the official install script:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"It sees the read-only root and installs into user space. You’ll get a bunch of “==>” lines and a prompt to press RETURN, then either:
- Prefix
/home/linuxbrew/.linuxbrew(the default when the installer can create thelinuxbrewuser/prefix), or - Prefix
/var/home/<you>/.linuxbrewif it can’t.
Both work. Your PATH lines in the next step must match your prefix. Don’t copy /home/linuxbrew/... if the installer used ~/.linuxbrew.
Creating /home/linuxbrew may ask for sudo. That’s for the directory and user, not for brew itself. Afterward, ls /home/linuxbrew/.linuxbrew/bin/brew (or ls ~/.linuxbrew/bin/brew) should show the binary.
If curl fails TLS, fix the host’s clock and CA trust first. Use this official script, not a random Fedora COPR.
Step 3: Add Homebrew to your PATH (Silverblue specific)
On Silverblue /home is a symlink to /var/home, so we set the environment using the absolute path.
These three commands add it to your .bashrc and activate it in the current terminal. This is the /home/linuxbrew/.linuxbrew version the installer usually prints:
echo >> "$HOME/.bashrc"echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv bash)"' >> "$HOME/.bashrc"eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv bash)"If your prefix is ~/.linuxbrew:
echo 'eval "$($HOME/.linuxbrew/bin/brew shellenv bash)"' >> "$HOME/.bashrc"eval "$($HOME/.linuxbrew/bin/brew shellenv bash)"brew shellenv exports PATH, MANPATH, INFOPATH, and HOMEBREW_PREFIX. If you only add PATH, brew works but compiles fail because HOMEBREW_PREFIX is unset.
Open a new terminal after editing .bashrc. On fish or zsh, use the shellenv fish / shellenv zsh lines the installer printed instead.
Flatpak IDEs (VS Code, etc.) often don’t read .bashrc. Add the same eval "$(… brew shellenv …)" to ~/.profile or the IDE’s terminal env settings.
Step 4: Verify the installation
Run the built-in check:
brew doctortype -a brewbrew --prefixA success message or the usual config warnings means you’re set.
brew --prefix should show /home/linuxbrew/.linuxbrew or /var/home/<you>/.linuxbrew. The first hit from type -a brew should be that prefix’s bin/brew.
Warnings about brew directories coming before /usr/bin are normal. Errors about unwritable prefixes mean you used sudo and root owns files. Fix ownership:
ls -ld "$(brew --prefix)"Install a tiny package to test it:
brew install hellohelloYou should see the GNU hello greeting. command -v hello should point under linuxbrew, not /usr/bin.
Quick reference for using brew on Silverblue
- No sudo: Never run
sudo brew install. Homebrew lives in your user space (/var/home/chrisor/home/linuxbrew/.linuxbrew). - OS upgrades: Your brew packages are separate from the system image, so they survive upgrades (e.g., Silverblue 43 to 44). Re-run
brew doctorafter a rebase if compilers complain. - Maintenance: Run
brew update && brew upgradewhenever you like, separate fromrpm-ostreeupdates. - Analytics:
brew analytics offturns off Homebrew’s anonymous metrics. - Uninstall a formula:
brew uninstall <name>. Uninstall Homebrew: use the official uninstall script from Homebrew’s repo, then remove theevallines from.bashrc.
Troubleshooting
Installer wants git, rpm-ostree says it conflicts
You tried to layer git. Use the Git already on Silverblue.
brew: command not found after a successful install
Your shell never ran shellenv. Run source ~/.bashrc or open a new terminal. Still failing? The eval line points at the wrong prefix. Compare with ls /home/linuxbrew/.linuxbrew/bin/brew.
Permission denied under .linuxbrew
A previous sudo brew or a root-owned extract. Run sudo chown -R "$USER:$USER" on your ~/.linuxbrew only. Don’t chown /usr.
Formula needs a library that is “in Fedora but not visible”
Brew bottles expect glibc and a few system libs from the host, which is fine on Silverblue. If a formula wants a devel package, layer that one or pick a bottle-friendly formula. Don’t start layering Homebrew’s whole dependency tree or you’re back to the reboot tax.
Toolbox confusion
which brew inside a toolbox is a different OS. Install brew on the host or in the toolbox, not both. I use the host so every terminal and IDE sees the same prefix.
Wrap-up
That’s it: a small ostree (gcc + make), CLIs in seconds, and rebases don’t wipe your tools. More Fedora guides are on the Fedora tag page.
Best regards,
The Linux IT Guy