In this guide, we want to teach you to Install Homebrew or Brew on Debian 11.
Homebrew, also known as Brew, is a command line package manager primarily created for macOS.
Homebrew grew quite popular among macOS users as more developers created command-line tools that could be easily installed with Homebrew.
This popularity resulted in the creation of Linuxbrew, a Linux port for Homebrew. Since it is primarily Git and Ruby, and Linux and macOS are both Unix-like systems, Brew works well on both kinds of operating systems.
Steps To Install Homebrew on Debian 11
To complete this guide, you must log in to your server as a non-root user with sudo privileges. To do this, you can follow our guide on Initial Server Setup with Debian 11.
Brew Installation on Debian 11
First, you need to update your local package index with the following command:
sudo apt update
Install build-essential and Git packages
Then, you need to install the build-essential package on your server. To do this run the command below:
sudo apt install build-essential -y
build-essential is what is called a meta-package. It in itself does not install anything. Instead, it is a link to several other packages that will be installed as dependencies.
Now you need to install git on Debian 11 with the following command:
sudo apt install git -y
Brew’s official website provides a script for downloading and installing Homebrew.
Download Homebrew Installer Script
You can download and run the Homebrew script with the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
This will take some time to complete.
When your Homebrew installation on Debian 11 is completed, you need to add the Brew command to the system path:
# echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/orca/.profile
# eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
The eval command is used to execute the arguments as a shell command on UNIX or Linux systems.
Then, you need to install GCC with the brew command on your server:
brew install gcc
Start Brew on Debian 11
At this point, run the brew help to get started the Homebrew on Debian 11:
brew search TEXT|/REGEX/
brew info [FORMULA|CASK...]
brew install FORMULA|CASK...
brew upgrade [FORMULA|CASK...]
brew uninstall FORMULA|CASK...
brew list [FORMULA|CASK...]
brew install --verbose --debug FORMULA|CASK
brew create URL [--no-fetch]
brew edit [FORMULA|CASK...]
brew help [COMMAND]
To verify that Homebrew is working correctly on Debian 11, run the following command:
Your system is ready to brew.
For more information, you can visit the Homebrew documentation page.
At this point, you have learned to Install Homebrew (brew) on Debian 11.
Hope you enjoy it. Also, you may be like these articles on the orcacore website: