How to automatically install Homebrew at home and abroad (Mac & Linux)

introduce

Homebrew is an open source package manager for macOS and Linux operating systems that allows users to easily install, upgrade, and manage a variety of software packages and tools. Homebrew's goal is to simplify the installation and maintenance process of software packages, allowing users to quickly obtain the tools and applications they need.

Install

1, The official website recommends the installation method. If you are in China, you need to use a VPN to access Tongtong
Install Homebrew on macOS:
Open the Terminal application and run the following command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Installing Homebrew on Linux:
First, make sure your Linux distribution supports Homebrew. Then, run the following command in the terminal:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

2, Domestic installation method
Install Homebrew on macOS:
Open the Terminal application and run the following command:

#常规安装脚本(推荐 完全体 几分钟安装完成)
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)")"

#极速安装脚本(精简版 几秒钟安装完成)
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)" speed

Uninstall Homebrew on macOS:

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/HomebrewUninstall.sh)"

Installing Homebrew on Linux:
First, make sure your Linux distribution supports Homebrew. Then, run the following command in the terminal:

rm Homebrew.sh ; wget https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh ; bash Homebrew.sh

Uninstall Homebrew on Linux:

rm HomebrewUninstall.sh ; wget https://gitee.com/cunkai/HomebrewCN/raw/master/HomebrewUninstall.sh ; bash HomebrewUninstall.sh

Common errors reported during domestic installation: https://gitee.com/cunkai/HomebrewCN/blob/master/error.md

use

1. After the installation is successful, enter the test on the command line:

brew 

2. Install git, example

#安装git前看都homebrew包管理器都有哪个版本
brew search git

#默认下载latest版本
brew install git

Please refer to the official documentation for specific operations: https://docs.brew.sh/Manpage

Guess you like

Origin blog.csdn.net/weixin_49319422/article/details/132896922