How to install Homebrew on Linux?
Last updated
Last updated
Homebrew is a package manager developed initially for macOS. It was created to simplify the process of installing and managing software. With Homebrew, you can easily install, upgrade, and remove software packages with just a few commands. You can take advantage of its community-driven development and keep your system up to date with the latest software. As a result of the tool's growing popularity and user-friendliness, Homebrew developers produced a native Linux version.
Let's see step by step how we can install Homebrew on Linux.
There are certain prerequisites that need to be met before you begin.
Linux server or operating system
Bash shell
GCC and related build tools
Understanding of the Linux command line
Non-root user with sudo privileges
Step 1: Update the package repository so the system has the latest software and security updates.
Step 2: Run the following command to install essential tools and libraries.
Enter y to continue.
Note: For CentOS, Rocky Linux, and other related distributions, compiling tools package is called Development Tools.
To install it, run the following command.
Step 3: Run the following command to verify if the compiler exists.
Output:
Step 4: Install Homebrew by running the following command.
Note: If it asks for the password, enter the same password you set when you installed Ubuntu.
Step 5: To confirm, press Enter and wait for the installation to finish.
Step 6: To set up your shell environment for working with Homebrew packages, we must set the path. Run the commands appearing on your output terminal to set the Homebrew path.
Step 7: Use the command below to verify if Homebrew is installed correctly.
After going through this guide, you should understand how to set up Homebrew on a Linux distribution.