Install and Use HomeBrew on Rocky Linux 8

In this guide, we want to teach you to Install and Use HomeBrew on Rocky Linux 8.

Homebrew 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.

How To Install and Use HomeBrew on Rocky Linux 8

To install HomeBrew, you must log in to your server as a non-root user with sudo privileges and set up a basic firewall. To do this, you can follow our guide the Initial Server Setup with Rocky Linux 8.

Install HomeBrew on Rocky Linux 8

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

sudo dnf update -y

Then, you need to install Git on Rocky Linux 8:

sudo dnf install git -y

Next, you need to download the HomeBrew installer script on Rocky Linux 8 by using the curl command:

Remember to run this command without a root user.

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

This command will take some time to complete.

When your Homebrew installation on Rocky Linux 8 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/orca/.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.

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

sudo yum groupinstall 'Development Tools'

Now run the brew help to get started the Homebrew on Rocky Linux 8:

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 Rocky Linux 8, run the following command:

brew doctor
Output
Your system is ready to brew.

How To Use HomeBrew

Homebrew collects user data and sends analytics to the developers using anonymized behavioral tracking, you may have no problem with that, or you prefer to disable it.

If you want to disable analytics, enter this command:

brew analytics off 

Also, you can install, upgrade, and remove your favorite packages, it’s recommended to start with the tree package, it allows you have a graphical directory tree. You can install it using the below command.

brew install tree

This command will update the Homebrew packages list, then install the tree command.

To update all formulae software and brew, enter:

brew update

To uninstall a package, write this command:

brew uninstall {package name}

Uninstall HomBrew

To uninstall Hombrew from your Rocky Linux 8, 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 learn to Install HomeBrew on Rocky Linux 8 and basic usage of it.

Hope you enjoy it.

You may be interested in these articles:

How To Secure Apache with Let’s Encrypt on Rocky Linux 8

Install and Configure XRDP on Rocky Linux 8

How To Install LEMP Stack on Rocky Linux 8

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!