Linux 使用 Homebrew 安装 Jsonnet

Summary: Author: 张亚飞 | Read Time: 2 minute read | Published: 2022-08-08
Filed under Categories: DevOpsTags: Linux, Server, Software, DevOps,

Linux 使用 Homebrew 安装 Jsonnet

首先升级 curl 版本

Homebrew 需要依赖 curl 版本要求在 7.41.0 以上,CentOS 自带的 curl 版本较低,否则安装 brew 报以下错:

The version of cURL that was found does not satisfy requirements for Homebrew.
Please install cURL 7.41.0 or newer and add it to your PATH.

查看当前系统 curl 版本

curl --version
curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.53.1 zlib/1.2.7 libidn/1.28 libssh2/1.8.0

升级 curl 版本

  1. 首先安装 epel-release
yum -y install epel-release 
  1. 安装 curlrpm
wget http://mirror.city-fan.org/ftp/contrib/yum-repo/rhel7/x86_64/city-fan.org-release-3-8.rhel7.noarch.rpm
sudo rpm -ivh city-fan.org-release-3-8.rhel7.noarch.rpm
  1. 更新 curl
yum update curl --enablerepo=city-fan.org -y
  1. 安装完成,检查版本
curl --version

安装 homebrew

下载 install.sh 安装脚本

wget https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh
wget https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh
chmod +x install.sh uninstall.sh

修改 install.sh 下载镜像

HOMEBREW_BREW_DEFAULT_GIT_REMOTE="git://mirrors.ustc.edu.cn/brew.git"
# 原来是"https://github.com/Homebrew/brew"
HOMEBREW_CORE_DEFAULT_GIT_REMOTE="git://mirrors.ustc.edu.cn/homebrew-core.git"
# 原来是"https://github.com/Homebrew/homebrew-core"

执行安装 ./install

...
==> Next steps:
- Run these two commands in your terminal to add Homebrew to your PATH:
    (echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /home/coam/.bash_profile
    eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
- Install Homebrew's dependencies if you have sudo access:
    sudo yum groupinstall 'Development Tools'
  For more information, see:
    https://docs.brew.sh/Homebrew-on-Linux
- We recommend that you install GCC:
    brew install gcc
- Run brew help to get started
- Further documentation:
    https://docs.brew.sh

按提示执行

(echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /home/coam/.bash_profile
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

添加中科大仓库

echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile

安装开发工具包

sudo yum groupinstall 'Development Tools'

查看安装版本信息

$ brew --version
Homebrew 4.1.1
Tue Jul 25 11:47:18 coam@bjy-idc-brtc-test01:/opt/run$ brew config
HOMEBREW_VERSION: 4.1.1
ORIGIN: git://mirrors.ustc.edu.cn/brew.git
HEAD: 3b3300546b5a4e40b74f4ee33cf225cca280defe
Last commit: 20 hours ago
Core tap JSON: 25 Jul 03:49 UTC
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_BOTTLE_DOMAIN: https://mirrors.ustc.edu.cn/homebrew-bottles
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 12
Homebrew Ruby: 2.6.10 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.10_1/bin/ruby
CPU: dodeca-core 64-bit presler
Clang: N/A
Git: 2.41.0 => /bin/git
Curl: 8.2.0 => /bin/curl
Kernel: Linux 3.10.0-1160.88.1.el7.x86_64 x86_64 GNU/Linux
OS: CentOS Linux release 7.9.2009 (Core)
Host glibc: 2.18
/usr/bin/gcc: 4.8.5
/usr/bin/ruby: N/A
glibc: N/A
gcc@11: N/A
gcc: N/A
xorg: N/A

安装 jsonnet

brew install jsonnet

brew.sh CentOS 安装brew

Comments

Cor-Ethan, the beverage → www.iirii.com