How to Install Homebrew on Fedora Linux

Last updated Monday, March 9, 2026 6:36 pm Joshua James 6 min read

Some developer tools move faster than Fedora’s repositories, and Homebrew gives Linux a separate package manager for command-line tools, language runtimes, and utilities in that gap. That makes it useful to install Homebrew on Fedora without any Mac background, because brew keeps its own formulas under /home/linuxbrew/.linuxbrew instead of mixing them into DNF.

Fedora does not ship Homebrew as a dnf install brew package. Homebrew on Linux used to be called Linuxbrew. On Fedora Workstation or Server, the supported install uses sudo once to create that shared prefix before the rest of your brew commands run as your normal user.

Install Homebrew on Fedora

Homebrew is a separate package manager on Linux, so the setup is mostly about getting the documented build tools in place before you run the official installer.

Update Fedora and install Homebrew prerequisites

Homebrew’s Linux requirements for Fedora start with the development-tools group plus procps-ng, curl, and file. These commands work on Fedora Workstation, Server, and trimmed virtual machine images, though fuller desktops may already have some of the packages installed.

sudo dnf upgrade --refresh

This guide uses sudo for commands that need root privileges. If your account is not in the sudoers file yet, follow the guide on how to add a user to sudoers on Fedora before continuing.

Refresh the package metadata first, then install the prerequisites Homebrew documents for Fedora:

sudo dnf group install development-tools
sudo dnf install procps-ng curl file

The development-tools group pulls in GCC, make, git, and related build utilities Homebrew expects on Linux. For deeper coverage of those dependencies, see install Git on Fedora and the curl command in Linux guide. On Fedora Workstation, DNF may report that some packages are already installed, and that is normal.

Run the official Homebrew installer

Run the supported installer from brew.sh. The script explains what it will change, then asks for confirmation before it creates the shared prefix under /home/linuxbrew. If Fedora’s system Ruby is not what Homebrew expects, the installer downloads Homebrew Portable Ruby automatically.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
==> Updating Homebrew...
==> Downloading https://ghcr.io/v2/homebrew/core/portable-ruby/blobs/sha256:63a9c333137e7cf8a568e0f37ec6802c22fbbdd5839f4825c863c26e415d2947
######################################################################## 100.0%
==> Pouring portable-ruby-3.4.8.x86_64_linux.bottle.tar.gz
Warning: /home/linuxbrew/.linuxbrew/bin is not in your PATH.
  Instructions on how to configure your shell for Homebrew
  can be found in the 'Next steps' section below.
==> Installation successful!

==> Next steps:
- Run these commands in your terminal to add Homebrew to your PATH:
    echo >> /home/joshua/.bashrc
    echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv bash)"' >> /home/joshua/.bashrc
    eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv bash)"
- Install Homebrew's dependencies if you have sudo access:
    sudo dnf group install development-tools

The rc-file path in that output reflects the Fedora username used during testing, so it will not literally be /home/joshua/.bashrc on your system. Current Linux installs also print analytics, documentation, donation, and brew install gcc suggestions around the same next-step block, so your output may be a little longer than the excerpt shown here. The important part is the brew shellenv bash line that the installer prints for your account.

Add Homebrew to your shell path

Use the same shellenv commands from the installer so new Bash sessions can find brew immediately.

echo >> ~/.bashrc
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv bash)"' >> ~/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv bash)"

The first echo adds a blank line before the new entry. If you use Zsh instead of Bash, write the same line to ~/.zshrc, or $ZDOTDIR/.zshrc if you keep a custom ZDOTDIR, and replace bash with zsh in the brew shellenv command.

Verify the Homebrew installation

Check the version first, then let Homebrew run its built-in diagnostics.

brew --version
brew doctor
Homebrew 5.0.16

Your system is ready to brew.

The version number will change as Homebrew ships new releases, but the healthy brew doctor message should stay the same.

Install a test formula with Homebrew

A quick hello install confirms that Homebrew can fetch a bottle, place it under the Linux prefix, and run the resulting command on Fedora.

brew install hello
hello
==> Pouring hello--2.12.2.x86_64_linux.bottle.tar.gz
Hello, world!

Remove the test formula when you are done:

brew uninstall hello
Uninstalling /home/linuxbrew/.linuxbrew/Cellar/hello/2.12.2... (57 files, 338.6KB)

Manage Homebrew Packages on Fedora

Once Homebrew is working, these are the commands you will use most often for day-to-day package management inside the brew prefix.

Search, inspect, and install Homebrew formulas

Replace hello with the formula you actually want to manage:

brew search hello
brew info hello
brew install hello

If you want to compare Homebrew-managed tools with Fedora’s native packages, useful reference points are install Git on Fedora, install Golang on Fedora, and install Neovim on Fedora.

Update and clean up Homebrew

Use Homebrew’s own update and cleanup commands when you are managing software inside the brew prefix instead of through DNF.

brew update
brew upgrade
brew outdated
brew cleanup --dry-run
brew cleanup

brew outdated gives you a quick list of pending upgrades. The dry run keeps cleanup predictable by showing which old downloads and bottles would be removed before anything is deleted.

Troubleshoot Homebrew on Fedora

Most Homebrew problems on Fedora come from shell setup or ownership changes after someone runs brew with sudo. These checks are faster than reinstalling the whole prefix.

Fix brew: command not found on Fedora

A fresh shell will not find Homebrew until you load its shellenv and save the same line in ~/.bashrc. The grep check below uses the same matching pattern covered in the grep command in Linux guide if you want to adapt it for another shell rc file.

eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv bash)"
brew --version
grep -Fq "brew shellenv bash" ~/.bashrc && echo "Found in .bashrc" || echo "Not in .bashrc"
Homebrew 5.0.16
Not in .bashrc

If the last line says Not in .bashrc, append the Bash entry now and then open a new shell:

echo >> ~/.bashrc
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv bash)"' >> ~/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv bash)"

Fix Homebrew permission errors on Fedora

A healthy install keeps /home/linuxbrew root-owned while the writable prefix under /home/linuxbrew/.linuxbrew belongs to your user. Check that layout before changing ownership:

ls -ld /home/linuxbrew /home/linuxbrew/.linuxbrew
drwxr-xr-x. 1 root   root    20 Mar  9 18:06 /home/linuxbrew
drwxr-xr-x. 1 joshua joshua 126 Mar  9 18:06 /home/linuxbrew/.linuxbrew

If the second line is owned by root or another user, repair the writable prefix ownership:

sudo chown -R "$(whoami)":"$(id -gn)" /home/linuxbrew/.linuxbrew

Confirm that Homebrew is healthy again after the ownership repair:

brew doctor
Your system is ready to brew.

Never run brew commands with sudo. The installer needs elevated privileges only while it prepares the shared prefix under /home/linuxbrew.

Remove Homebrew from Fedora

Start with Homebrew’s official uninstaller so the cache and shared prefix are cleaned up in the order the project expects.

Run the official Homebrew uninstaller

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"

During Fedora validation, the tail of the uninstaller output looked like this:

==> Removing Homebrew installation...
==> Removing empty directories...
==> Homebrew uninstalled!
The following possible Homebrew files were not deleted:
/home/linuxbrew/.linuxbrew/lib/
You may wish to remove them yourself.

The official uninstaller removed ~/.cache/Homebrew, but it still left /home/linuxbrew/.linuxbrew/lib/ld.so behind and did not remove the saved Bash entry from ~/.bashrc.

Remove leftover Homebrew files from Fedora

Only run the next cleanup step after the official uninstaller finishes and you have confirmed that you no longer need any Homebrew-managed files.

Remove the shared Homebrew prefix first:

sudo rm -rf /home/linuxbrew/.linuxbrew
sudo rmdir /home/linuxbrew

If you added Homebrew to Bash, remove the saved brew shellenv bash line from ~/.bashrc so new shells stop loading Homebrew after you remove the prefix:

sed -i '/brew shellenv bash/d' ~/.bashrc

If you use Zsh instead, remove the matching line from ~/.zshrc. With a custom ZDOTDIR, point the same command at $ZDOTDIR/.zshrc instead:

sed -i '/brew shellenv zsh/d' ~/.zshrc

Use only the rc-file cleanup command that matches your shell. If you skip it, Bash or Zsh can complain that /home/linuxbrew/.linuxbrew/bin/brew no longer exists the next time a new shell opens.

Confirm the shared prefix is gone:

ls -ld /home/linuxbrew /home/linuxbrew/.linuxbrew 2>/dev/null || echo removed
removed

The official uninstall removed ~/.cache/Homebrew, and the default install did not create separate ~/.config/Homebrew, ~/.local/share/Homebrew, ~/.var/app, or ~/.linuxbrew directories.

Frequently Asked Questions

Does Homebrew replace DNF on Fedora?

No. Homebrew installs to /home/linuxbrew/.linuxbrew and manages only the formulas inside that prefix. DNF still manages Fedora packages separately, so you can use both package managers side by side.

Can I install Homebrew with DNF on Fedora?

No. Fedora does not ship Homebrew as a dnf install brew package. The supported path is the official installer from brew.sh after you install Homebrew’s prerequisite packages.

Is Linuxbrew the same as Homebrew on Fedora?

Yes. Linuxbrew was the older project name for Homebrew on Linux. Current documentation uses the Homebrew name for both macOS and Linux, but older tutorials and forum posts still use Linuxbrew.

Why does Fedora say brew: command not found after installation?

That usually means the installer finished, but your shell has not loaded Homebrew’s shellenv line yet. Run eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv bash)" in the current shell and save the same line in ~/.bashrc so new terminals can find brew.

Can I install Homebrew on Fedora without sudo or admin access?

Not with the supported default install. Homebrew’s Linux prefix lives under /home/linuxbrew/.linuxbrew, so the initial setup needs elevated privileges. If you do not have admin access, ask an administrator to create the linuxbrew role account and prefix for you instead of using an unsupported custom prefix.

Conclusion

Homebrew is running on Fedora from its supported Linux prefix, and DNF can keep handling the system packages Homebrew was never meant to replace. If you want more tools under the same workflow, install Git on Fedora, install Golang on Fedora, or install Neovim on Fedora next.

Search LinuxCapable

Need another guide?

Search LinuxCapable for package installs, commands, troubleshooting, and follow-up guides related to what you just read.

Found this guide useful?

Support LinuxCapable to keep tutorials free and up to date.

Buy me a coffee Buy me a coffee

Before commenting, please review our Comments Policy.
Formatting tips for your comment

You can use basic HTML to format your comment. Useful tags currently allowed in published comments:

You type Result
<code>command</code> command
<strong>bold</strong> bold
<em>italic</em> italic
<blockquote>quote</blockquote> quote block

Got a Question or Feedback?

We read and reply to every comment - let us know how we can help or improve this guide.

Let us know you are human: