Your cart is currently empty!
How to Install Homebrew on Linux
Homebrew is a popular package manager, famous for its simplicity on macOS. But did you know you can use Homebrew on Linux too? If you’re looking for an easy way to manage software on your Linux machine, Homebrew is a solid choice. Here’s exactly how to get it up and running.
What Is Homebrew?
Homebrew lets you install, update, and remove software using simple commands. It manages dependencies for you and keeps everything organized in one place—making your life easier, especially if you often work with open-source tools.
Step 1: Prerequisites
Before installing Homebrew, make sure you have:
- A Linux machine (Ubuntu, Debian, Fedora, etc.)
- A non-root user with sudo privileges
- Basic developer tools (
git
,curl
, andbuild-essential
or similar)
To install the essentials, run:
sudo apt update
sudo apt install build-essential curl file git
Use your distro’s package manager if not on Ubuntu/Debian.
Step 2: Install Homebrew
The official Homebrew install script works for Linux. To install, just open your terminal and paste:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
The script explains what it will do and then pauses before it does it.
Step 3: Add Homebrew to Your Path
After installation, you’ll see a message like this:
==> Next steps:
- Add Homebrew to your PATH in /home/linuxbrew/.linuxbrew/bin
You can add Homebrew to your shell profile. For most users:
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
- If you use Zsh: replace
~/.bashrc
with~/.zshrc
- For other shells, adjust as needed.
Step 4: Verify the Installation
Make sure Homebrew is set up:
brew --version
You should see the version number.
Step 5: Using Homebrew
You’re ready to go! Here’s how you can install packages:
brew install <package-name>
For example, to install htop
:
brew install htop
Troubleshooting
- If you see permission errors, make sure you’re not running as root.
- Check Homebrew’s official docs for advanced tips.
Why Use Homebrew on Linux?
- Simple, unified package management
- Access to thousands of open-source tools
- Easy upgrades and uninstalls
Final Thoughts
Homebrew isn’t just for Mac. It’s a modern, flexible way to manage software on Linux, and installation is a breeze. Try it out, and you’ll probably never want to go back.
Got questions? Drop them in the comments below.
Tech enthusiast and content creator passionate about making technology simple for everyone. I share practical tips, guides, and reviews on the latest in computers, software, and gadgets. Let’s explore the digital world together!