ubuntu上安装brew

在linux,尤其是无root权限的服务器上安装brew是个挑战。

  1. 直接 git clone的方式有问题,无法适配使用的zsh,各种报错,如/bin/sh^M: bad interpreter: No such file or directory,
    或者brew install package时报错。

成功的安装方式

虽然从raw.githubusercontent.com下载东西真的很崩溃,但是还是成功了。
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"

测试
brew install hello

1
2
3
4
5
6
7
8
9
isl@0.18 is keg-only, which means it was not symlinked into /home/zwx/.linuxbrew,
because this is an alternate version of another formula.

For compilers to find isl@0.18 you may need to set:
export LDFLAGS="-L/home/zwx/.linuxbrew/opt/isl@0.18/lib"
export CPPFLAGS="-I/home/zwx/.linuxbrew/opt/isl@0.18/include"

For pkg-config to find isl@0.18 you may need to set:
export PKG_CONFIG_PATH="/home/zwx/.linuxbrew/opt/isl@0.18/lib/pkgconfig"