MacOS installation brew tutorial from entry to entry

1. Open the macos terminal and enter 

/bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/install.sh)"

2. Wait for the prompt after the installation is complete

 

The prompt needs to execute a command to add homebrew to the path, copy the prompt text and continue to execute in the terminal. Note that everyone’s computer name is different here, so be sure to copy the command prompted in your own terminal. Mine is just a reference, directly Just copy everything, no need to change lines and adjust formatting

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/zyyt/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"

  3. At this time, execute brew help again, and you can see the relevant information prompting that there is already brew

4. Switch the address of the brew download package to a domestic mirror address, which is the same as switching the download address of npm to Taobao Mirror

Execute the following 4 commands in sequence 

git -C "$(brew --repo)" remote set-url origin https://mirrors.ustc.edu.cn/brew.git
 
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
 
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
 
brew update

5. Set the bottles image 

Proceed with the following command

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

 

Above, all the configurations of homebrew have been completed, and you can use homebrew to install the packages you want

brew install XX package name

 

Guess you like

Origin blog.csdn.net/MrWangisgoodboy/article/details/127609389