brew command not found - Amazon Linux

Page content

How to Install brew on Amazon Linux

If you are using Amazon Linux and trying to install the brew command but encountering a “command not found” error, you’re not alone. brew is a package manager primarily used on macOS systems, and it’s not natively available on Amazon Linux. However, there is a way to install and use it on Amazon Linux.

Step 1: Install Linuxbrew

Linuxbrew is a fork of Homebrew that works on Linux distributions. You can install Linuxbrew on Amazon Linux by running the following command:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"

This command will download and install Linuxbrew on your Amazon Linux system.

Step 2: Add Linuxbrew to Your PATH

After installing Linuxbrew, you need to add it to your PATH so that you can use the brew command. Add the following line to your .bashrc or .bash_profile file:

export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"

Then, source the file to apply the changes:

source ~/.bashrc

Step 3: Verify Installation

To verify that brew is now available on your Amazon Linux system, you can run:

brew --version

If you see the version information, it means that Linuxbrew has been successfully installed and configured on your system.

Conclusion

By following these steps, you can install and use the brew package manager on Amazon Linux. Linuxbrew provides a convenient way to install and manage packages on your system, similar to how Homebrew works on macOS. Enjoy using brew on your Amazon Linux machine!

Remember that Linuxbrew may not have the same package availability as Homebrew, so some packages may need to be installed using other methods specific to Amazon Linux.