Steps required to install Homebrew on MX Linux (and other Debian-based distros)
-
Update apt cache and optionally do a full upgrade
apt update apt full-upgrade # optional, reboot if needed -
Install build tools
apt install build-essential procps curl file git -
Install homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -
Set brew environment variables
[ -d /home/linuxbrew/.linuxbrew ] && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) # You most likely want to add the above line to your shell startup file as well. -
Make
brew doctorhappybrew doctor # Ignore the warning about config scripts -
Install gcc (as recommended by the installer script)
brew install gcc
Unfortunately
Homebrewis using a poor choice of install location that is very much against all Linux community standards. It creates a superficial user directory under/home/homebrew/.homebrew.In all other linux packages known to man, that has never been done before, and should never be done again.
Instead homebrew should go into
/opt/homebrewand nowhere else. If you know how to use linux file permissions, this can be easily done with:After this,
sudoshould never be needed and file permissions will be propagated automatically to new installs and updates.