How To Set up HomeBrew on AlmaLinux 9

This guide intends to teach you to Set up and Install HomeBrew or Brew on AlmaLinux 9.

Homebrew or Brew is an open-source software package manager that makes it easier to install software on macOS (Apple’s operating system) and Linux.

Basically, a package manager’s job is to find and install the right software packages that will allow you to compile and run various apps/software on your specific operating system. A package manager, like Homebrew, does a lot of tedious time-consuming work that you would otherwise have to do manually.

Steps To Set up HomeBrew on AlmaLinux 9

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 AlmaLinux 9.

Install Brew on AlmaLinux 9

First, you need to update your local package index with the following command:

sudo dnf update -y

Then, you need to install Git on your server by using the following command:

sudo dnf install git -y

Download HomeBrew Installer Script

At this point, you need to download the HomeBrew installer script on AlmaLinux 9 by using the curl command:

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

This command will take some time to complete.

Add Brew to System Path

When your Brew installation on AlmaLinux 9 is completed, you need to add the Brew command to the system path. To do this, you can run the following commands:

# echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/reita/.bash_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.

Install Development Tools

Then, you need to install Development tools with the following command:

sudo dnf groupinstall 'Development Tools'

Start Brew on AlmaLinux 9

Now run the brew help to get started the Homebrew on AlmaLinux 9:

brew help
Output
Example usage:
brew search TEXT|/REGEX/
brew info [FORMULA|CASK...]
brew install FORMULA|CASK...
brew update
brew upgrade [FORMULA|CASK...]
brew uninstall FORMULA|CASK...
brew list [FORMULA|CASK...]

Troubleshooting:
brew config
brew doctor
brew install --verbose --debug FORMULA|CASK

Contributing:
brew create URL [--no-fetch]
brew edit [FORMULA|CASK...]

Further help:
brew commands
brew help [COMMAND]
man brew
https://docs.brew.sh

To verify that Homebrew is working correctly on AlmaLinux 9, run the following command:

brew doctor
Output
Your system is ready to brew.

For more information, you can visit the Homebrew documentation page.

Uninstall HomeBrew on AlmaLinux 9

To uninstall Homebrew from your server, you can download the “uninstall” script to your server and run it:

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

After reviewing the script contents, run this script to uninstall Homebrew:

bash uninstall.sh

Conclusion

At this point, you have learned to Set up and Install HomeBrew or Brew on AlmaLinux 9.

Hope you enjoy it.

You may be interested in these articles:

Install Rust Programming Language on AlmaLinux 9

How To Install Yarn on Rocky Linux 8

Upgrade Linux Kernel on AlmaLinux 8

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!