Skip to content

Instantly share code, notes, and snippets.

@taikedz
Created February 19, 2025 14:55
Show Gist options
  • Save taikedz/ed775cfbb2ffaab4ad033b7a9a8048c2 to your computer and use it in GitHub Desktop.
Save taikedz/ed775cfbb2ffaab4ad033b7a9a8048c2 to your computer and use it in GitHub Desktop.
Install linuxbrew

Install Linuxbrew

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'"
@taikedz
Copy link
Author

taikedz commented Feb 19, 2025

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/?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment