Very basic linuxbrew installer for general use-case
I've done this in a podman container as root with success; should work in a native environment
Not tried yet in regular user/sudo mode.
#!bash | |
set -euo pipefail | |
if [[ "$UID" != 0 ]]; then | |
echo "You must be root to run this script" | |
exit 1 | |
fi | |
if which dnf; then | |
dnf install git curl -y | |
dnf group install "Development Tools" | |
elif which apt-get; then | |
apt-get update && apt-get install git curl build-essential -y | |
else | |
echo "Unsupported" | |
exit 1 | |
fi | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /root/.bashrc | |
echo "Now ensure you have no backgrounded jobs (run 'jobs'), then run 'exec bash'" | |
echo "Install with 'brew install PACKAGES ...'" | |
echo "Search packages with 'brew search TERM' or 'brew search /REGEX/'" | |
echo "See package info with 'brew info PACKAGE'" |
I'll also add some bits for getting it running under CentOS7 eventually, but that will require compiling a new
git
https://joseph-long.com/writing/linuxbrew-with-ancient-git/?