Macos itself comes with Homebrew, but still try to install all, and will be the mirror source to the domestic Version of Gitee, so the following attempts


1. The ZSH? Bash?

When you update Catalina, you suddenly find that terminal defaults to ZSH instead of bash.

(Now, of course, it’s big Sur, a heavy load for MAC 15.)

What is the difference between bash and ZSH? What is the difference between ZSH and other Linux shells?

However, since the installation command line on homebrew’s website starts with /bin/bash and I’m more used to bash’s various looks, I decided to switch back to the bash shell.

Mac Terminal :The default Interactive shell is now ZSH

  1. View different shell styles/shells
more /etc/shells
Copy the code

  1. Switch the terminal to bash, or of course, change the path below if you want to use a different shell
chsh -s /bin/bash
Copy the code

Note: You need to restart the terminal after switching

2. Install homebrew

1. Normal operation

Follow the tutorial on the website:

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

But! If you are downloading in China, it is likely that you will encounter a problem as embarrassing as NPM… Very slow !!!!

Therefore, smart domestic compatriots, also provided similar taobao mirror, domestic mirror resources!

(Thank you guys)

2. Use domestic image resources

Refer to the article: zhuanlan.zhihu.com/p/111014448

Download command :(you can see it is pulled down by gitee)

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

Midway will be very intimate tips, need to choose which download source, WHEN I try, Tsinghua is available ~ if a failure, suggest another try

Then there will be many times when you need to use the sudo command. Just wait for him to download it all the way according to the steps. Finally, restart the terminal

Attach a homebrew website links, here lists can offset some package listing: the brew command for macos formulae. The brew. Sh/formula /