Introduction
1: Install the prerequisite packages
Step 2: Run the Homebrew installation script
Step 3: Configure Homebrew after installation
Test the installation
Possible errors Install Homebrew on Ubuntu in these steps: If you have used macOS before, you’ve probably come across brew (Homebrew). It’s a simple and powerful package manager that makes installing developer tools much easier. I previously used brew on macOS and really liked the experience, so I decided to try it on Ubuntu as well. My goal was to use both Homebrew and the native Ubuntu package manager apt in my development. In this guide, I’ll walk through how to install Homebrew on Ubuntu. Throughout this installation, we’ll reference the official Homebrew documentation: Homebrew requires a few system packages before installation.
Run the following command in your terminal: These packages provide the basic tools needed to compile and manage software. You can find the full requirements in the official guide:https://docs.brew.sh/Homebrew-on-Linux#requirements Next, run the official Homebrew installation script: At this point, press Enter/Return to continue the installation. The installation will proceed automatically, and once it finishes, the terminal will display the next steps required to configure Homebrew. After installation, Homebrew needs to be added to your shell environment. Add Homebrew to your PATH
If you are using bash, run: If you are using zsh, add the same command to ~/.zshrc. To confirm everything is working, run: If everything is set up correctly, you should see: You might encounter an error like this: This usually indicates a missing dependency, often Ruby. First, check whether Ruby is installed: If Ruby is missing, install it with: Alternatively, you can install all common Homebrew dependencies with: Templates let you quickly answer FAQs or store snippets for re-use. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse
$ -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install build-essential procps -weight: 500;">curl file -weight: 500;">git /bin/bash -c "$(-weight: 500;">curl -fsSL https://raw.githubusercontent.com/Homebrew/-weight: 500;">install/HEAD/-weight: 500;">install.sh)" echo >> /home/pc/.bashrc
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/-weight: 500;">brew shellenv bash)"' >> /home/pc/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/-weight: 500;">brew shellenv bash)"
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install build-essential procps -weight: 500;">curl file -weight: 500;">git /bin/bash -c "$(-weight: 500;">curl -fsSL https://raw.githubusercontent.com/Homebrew/-weight: 500;">install/HEAD/-weight: 500;">install.sh)" echo >> /home/pc/.bashrc
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/-weight: 500;">brew shellenv bash)"' >> /home/pc/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/-weight: 500;">brew shellenv bash)"
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install build-essential procps -weight: 500;">curl file -weight: 500;">git /bin/bash -c "$(-weight: 500;">curl -fsSL https://raw.githubusercontent.com/Homebrew/-weight: 500;">install/HEAD/-weight: 500;">install.sh)" echo >> /home/pc/.bashrc
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/-weight: 500;">brew shellenv bash)"' >> /home/pc/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/-weight: 500;">brew shellenv bash)"
-weight: 500;">brew doctor
-weight: 500;">brew doctor
-weight: 500;">brew doctor
Your system is ready to -weight: 500;">brew.
Your system is ready to -weight: 500;">brew.
Your system is ready to -weight: 500;">brew.
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install build-essential procps -weight: 500;">curl file -weight: 500;">git
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install build-essential procps -weight: 500;">curl file -weight: 500;">git
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install build-essential procps -weight: 500;">curl file -weight: 500;">git
/bin/bash -c "$(-weight: 500;">curl -fsSL https://raw.githubusercontent.com/Homebrew/-weight: 500;">install/HEAD/-weight: 500;">install.sh)"
/bin/bash -c "$(-weight: 500;">curl -fsSL https://raw.githubusercontent.com/Homebrew/-weight: 500;">install/HEAD/-weight: 500;">install.sh)"
/bin/bash -c "$(-weight: 500;">curl -fsSL https://raw.githubusercontent.com/Homebrew/-weight: 500;">install/HEAD/-weight: 500;">install.sh)"
echo >> /home/pc/.bashrc
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/-weight: 500;">brew shellenv bash)"' >> /home/pc/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/-weight: 500;">brew shellenv bash)"
echo >> /home/pc/.bashrc
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/-weight: 500;">brew shellenv bash)"' >> /home/pc/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/-weight: 500;">brew shellenv bash)"
echo >> /home/pc/.bashrc
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/-weight: 500;">brew shellenv bash)"' >> /home/pc/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/-weight: 500;">brew shellenv bash)"
-weight: 500;">brew doctor
-weight: 500;">brew doctor
-weight: 500;">brew doctor
Your system is ready to -weight: 500;">brew.
Your system is ready to -weight: 500;">brew.
Your system is ready to -weight: 500;">brew.
/home/pc/.linuxbrew/Library/-weight: 500;">brew.sh: line 177: exec: : not found
/home/pc/.linuxbrew/Library/-weight: 500;">brew.sh: line 177: exec: : not found
/home/pc/.linuxbrew/Library/-weight: 500;">brew.sh: line 177: exec: : not found
which -a ruby
which -a ruby
which -a ruby
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install ruby
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install ruby
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install ruby
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install build-essential -weight: 500;">curl -weight: 500;">git m4 ruby texinfo libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install build-essential -weight: 500;">curl -weight: 500;">git m4 ruby texinfo libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install build-essential -weight: 500;">curl -weight: 500;">git m4 ruby texinfo libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g - GitHub Repository
- Official Website - Show the packages that will be installed
- Display the directories that will be created
- Pause and ask whether you want to continue