I installed Homebrew on Amazon Linux2, so I'll leave a note as a memorandum.
Install by referring to Homebrew.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Then, if there is no path, the following caution will be displayed.
Warning: /home/linuxbrew/.linuxbrew/bin is not in your PATH.
Therefore, you can use it by executing the following command.
Make sure Homebrew is installed just in case.
It was recommended as
We recommend that you install GCC: brew install gcc, so it seems better to install gcc as well.
brew install gcc
Notes and recommendations
Warning: /home/linuxbrew/.linuxbrew/bin is not in your PATH. ==> Installation successful! ==> Homebrew has enabled anonymous aggregate formulae and cask analytics. Read the analytics documentation (and how to opt-out) here: https://docs.brew.sh/Analytics No analytics data has been sent yet (or will be during this `install` run). ==> Homebrew is run entirely by unpaid volunteers. Please consider donating: https://github.com/Homebrew/brew#donations ==> Next steps: - Run `brew help` to get started - Further documentation: https://docs.brew.sh - Install the Homebrew dependencies if you have sudo access: sudo yum groupinstall 'Development Tools' See https://docs.brew.sh/linux for more information - Add Homebrew to your PATH in /home/ec2-user/.bash_profile: echo 'eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)' >> /home/ec2-user/.bash_profile eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) - We recommend that you install GCC: brew install gcc