AlmaLinuxRHEL Based

How To Install Homebrew on AlmaLinux 10

Install Homebrew on AlmaLinux 10

If you have spent any time managing an AlmaLinux server, you have probably hit the same wall: the package you need is either missing from the default DNF repositories or the available version is several releases behind upstream. That is exactly the problem Homebrew solves — and in this guide, you will learn how to install Homebrew on AlmaLinux 10 from scratch, configure it properly, and start using it right away. By the end, you will have a fully working brew command on your AlmaLinux 10 “Purple Lion” server, with zero conflicts against your existing DNF-managed packages.

What Is Homebrew and Why Should You Use It on AlmaLinux 10?

Homebrew is a free, open-source package manager originally built for macOS that has since expanded full support for Linux systems. On Linux, it was historically called Linuxbrew, though the project merged into the main Homebrew codebase — it is now simply called Homebrew.

The core idea is straightforward: Homebrew installs software into /home/linuxbrew/.linuxbrew/, completely isolated from system directories like /usr or /etc. This means it never overwrites system packages, never breaks your OS toolchain, and does not require sudo once the initial setup is done.

Why Not Just Use DNF?

DNF is excellent for managing core system packages — it is what keeps AlmaLinux stable and RHEL-compatible. But it has a known limitation: it prioritizes stability over freshness.

Homebrew fills that gap perfectly. Here is when you should reach for brew instead of dnf:

  • You need a newer version of a tool (e.g., Python 3.13, Node.js 22+, or the latest Git)
  • A package is not available in AlmaLinux or EPEL repositories
  • You want to install developer CLI tools without touching system-level packages
  • You are managing a multi-OS workflow (macOS + Linux) and want a unified package manager across both environments

AlmaLinux 10 “Purple Lion” — A Quick Context

AlmaLinux 10, codenamed “Purple Lion”, was released in May 2025. It is built on Linux kernel 6.12 and is fully RHEL 10-compatible. The release ships with GCC 14.2, Python 3.12, Node.js 22, Ruby 3.3, PHP 8.3, Git 2.47, and a system toolchain featuring glibc 2.39.

That modern toolchain is actually good news for Homebrew users: newer glibc and GCC versions mean Homebrew can use pre-compiled bottles (binary packages) more reliably, which makes installations significantly faster than compiling from source.

One important note: AlmaLinux 10 has dropped all 32-bit (i686) packages, which aligns perfectly with Homebrew’s own requirements — Homebrew does not support 32-bit x86 platforms at all.

Prerequisites for This Linux Server Tutorial

Before you begin, confirm your environment meets the following requirements. Skipping this step is the number one cause of failed installations.

System Requirements:

  • AlmaLinux 10 (x86_64 or ARM64 architecture)
  • A non-root user account with sudo privileges — never run the Homebrew installer as root
  • Active internet connection
  • Minimum 1 GB of free disk space (more if you plan to install large packages)

Required Tools (installed in Step 2):

  • git — Homebrew clones its formula repository from GitHub
  • curl — downloads the installation script
  • gcc and make — compile packages that do not have pre-built bottles
  • procps-ng and file — utility libraries required by Homebrew’s internals

Access Method: Log in to your server as a non-root sudo user via SSH or a local terminal before proceeding.

Step 1: Update AlmaLinux 10 System Packages

Always start with a full system update. This ensures your package metadata is fresh, your installed packages are up to date, and you avoid dependency conflicts during the Homebrew setup process.

Run the following command:

sudo dnf update -y

This command tells DNF to refresh all repositories and upgrade every installed package non-interactively. Depending on your system’s state, this may take a few minutes.

After the update completes, confirm you are running AlmaLinux 10 by checking the OS release file:

cat /etc/os-release

Expected output (relevant lines):

NAME="AlmaLinux"
VERSION="10.0 (Purple Lion)"
ID="almalinux"

If you see AlmaLinux 10 in the output, you are ready to proceed.

Step 2: Install Required Dependencies for Homebrew on AlmaLinux 10 Setup

This is the step most tutorials underexplain, and it is also the step most likely to cause failures if skipped. Homebrew needs a working C compiler, a set of build tools, and a few core utilities to function correctly on AlmaLinux 10.

Install git and curl

git is required because Homebrew stores all of its package definitions (called formulae) in a GitHub repository. The installer will clone that repository during setup. curl downloads the install script itself.

sudo dnf install git curl -y

Verify they are correctly installed:

git --version
curl --version

You should see version output for both commands. If you do not, re-run the install command before moving forward.

Install the Development Tools Group

The Development Tools package group bundles gcc, g++, make, autoconf, automake, and other essential build utilities into a single install command.

sudo dnf groupinstall 'Development Tools' -y

This group install can take a few minutes. Do not interrupt it.

Install Additional Utilities

Homebrew’s internal scripts also require procps-ng (provides utilities like ps) and file (identifies file types). These are small but required packages.

sudo dnf install procps-ng file -y

At this point, all prerequisites are in place. You can now move on to the actual installation.

Step 3: Download and Run the Homebrew Installer

(Recommended) Review the Install Script First

As a sysadmin best practice, never pipe a remote script directly into bash without reading it first. Homebrew’s official installer is open source and widely audited, but it is still good hygiene.

First, download the script locally:

curl -fsSL -o install.sh https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh

Open it with less to review the contents:

less install.sh

Press q to exit when you are done reviewing.

Run the Installer

Once you are satisfied, run the official Homebrew install command:

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

Here is what this command does, step by step:

  1. curl -fsSL downloads the install script silently, failing gracefully on errors
  2. The script checks your system for all required dependencies
  3. It prompts you for your sudo password — this is only needed to create the /home/linuxbrew/.linuxbrew/ directory
  4. It clones the Homebrew repository from GitHub into that directory
  5. It downloads and installs core Homebrew components

When prompted with “Press RETURN/ENTER to continue or any other key to abort”, press Enter to proceed.

Important: The installation will take several minutes, especially on first run. This is normal — Homebrew is fetching its entire formula database from GitHub.

Step 4: Configure Your Shell Environment (Add Homebrew to PATH)

After the installer finishes, it prints a “Next steps” section directly in your terminal output. Do not ignore it — the brew command will not be found until you complete this step.

For bash Users (Default on AlmaLinux 10)

Add Homebrew to your shell environment by running both of these commands:

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

The first command permanently writes the Homebrew environment setup into your ~/.bash_profile, so it loads automatically on every login. The second command activates it in your current terminal session immediately, without requiring a logout.

For zsh Users

If you are using zsh, substitute ~/.zshrc for ~/.bash_profile:

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

Apply the Changes

Reload your shell profile to make sure the changes are active:

source ~/.bash_profile

Now verify that the system can locate the brew binary:

which brew

Expected output:

/home/linuxbrew/.linuxbrew/bin/brew

If you see that path, Homebrew is correctly on your PATH and ready to use.

Step 5: Verify the Installation with brew doctor

Homebrew ships with a built-in diagnostic command called brew doctor. It checks your installation for common problems and reports anything that could cause issues.

Run it now:

brew doctor

Expected output:

Your system is ready to brew.

If you see that message, everything is working correctly. If brew doctor returns warnings, read each one carefully — most are informational and do not block usage. Actual errors (not warnings) need to be addressed before continuing.

Also confirm the installed Homebrew version:

brew --version

You should see a version string similar to Homebrew 4.x.x. This confirms the binary is accessible and functional.

Step 6: Install Your First Package Using Homebrew on AlmaLinux 10

Now the fun part. Let’s install a real package to confirm the full workflow. We will use htop, a popular interactive process viewer.

brew install htop

When you run this, Homebrew does the following:

  1. Checks if a pre-compiled bottle (binary package) exists for your system
  2. Downloads and installs the bottle if available — this is fast, usually under a minute
  3. Falls back to compiling from source if no bottle exists — this is slower but automatic

Once installed, run it to confirm:

htop

Press q to exit htop. The fact that it launched confirms Homebrew is fully functional on your AlmaLinux 10 server.

Essential brew Commands to Know

Here are the core commands you will use day-to-day:

# Search for a package
brew search node

# Get detailed info about a package before installing
brew info node

# Install a package
brew install node

# List all installed packages
brew list

# Update Homebrew's formula database
brew update

# Upgrade all installed packages
brew upgrade

# Upgrade a specific package
brew upgrade htop

# Uninstall a package
brew uninstall htop

# Clean up old package versions and cache
brew cleanup

The brew update && brew upgrade combination is your routine maintenance command — run it periodically to keep your Homebrew-installed tools current.

Troubleshooting Common Errors When You Configure Homebrew on AlmaLinux 10

Even with a clean setup, you may hit one of these common issues. Here is how to resolve each one.

Error 1: brew: command not found

Cause: Homebrew was not added to your PATH, or the shell profile was not reloaded.

Fix: Re-run the PATH configuration commands from Step 4, then reload your profile:

eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
source ~/.bash_profile

Error 2: Build Failures or “Missing Dependencies”

Cause: The Development Tools group or one of the required packages was not installed correctly.

Fix: Re-install the dependencies and let Homebrew install its own GCC version:

sudo dnf groupinstall 'Development Tools' -y
brew install gcc

Error 3: Permission Denied During Installation

Cause: The Homebrew installer was run as root (sudo /bin/bash -c ...) instead of as a regular sudo user.

Fix: Do not use sudo in front of the install command. Log in as a non-root user with sudo privileges and run the installer without the sudo prefix. Homebrew will ask for your password when it needs elevated access.

Error 4: brew doctor Warnings About PATH

Cause: The brew shellenv line is in ~/.bashrc instead of ~/.bash_profile, or the file was not sourced.

Fix: Ensure the eval line is in ~/.bash_profile (for login shells on AlmaLinux), then run:

source ~/.bash_profile
brew doctor

Error 5: SSL / Certificate Errors During Download

Cause: An outdated ca-certificates package on the system.

Fix:

sudo dnf install ca-certificates -y
sudo update-ca-trust

Then re-run the Homebrew installer.

How to Uninstall Homebrew from AlmaLinux 10

If you ever need to remove Homebrew completely, use the official uninstall script — do not manually delete the directory, as that can leave leftover configuration.

Download the uninstall script:

curl -fsSL -o uninstall.sh https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh

Review it if you wish:

less uninstall.sh

Then run it:

bash uninstall.sh

After uninstalling, remove the Homebrew PATH entry from your ~/.bash_profile or ~/.zshrc to prevent “command not found” errors in future terminal sessions.

Congratulations! You have successfully installed Homebrew. Thanks for using this tutorial for installing Homebrew on your AlmaLinux OS 10 system. For additional help or useful information, we recommend you check the official Homebrew website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is a dedicated and highly skilled Linux Systems Administrator with over a decade of progressive experience in designing, deploying, and maintaining enterprise-grade Linux infrastructure. His professional journey began in the telecommunications industry, where early exposure to Unix-based operating systems ignited a deep and enduring passion for open-source technologies and server administration.​ Throughout his career, r00t has demonstrated exceptional proficiency in managing large-scale Linux environments, overseeing more than 300 servers across development, staging, and production platforms while consistently achieving 99.9% system uptime. He holds advanced competencies in Red Hat Enterprise Linux (RHEL), Debian, and Ubuntu distributions, complemented by hands-on expertise in automation tools such as Ansible, Terraform, Bash scripting, and Python.
Back to top button