Failed to install Homebrew

1. Why do you need to install Homebrew

  Today, when you want to compile and build Nginx on your computer, you need to download the corresponding source code from the official website to compile and install. When using the wget command, the prompt is invalid. Then use yum to install wget and find it is invalid. Finally, I found that I did n’t even have an RPM (Red Hat System Package Management Tool) in my computer. At that time, I found it useless. Just download a Homebrew, so that you do n’t have to worry about so much when using the mac books. Package management is relatively easy to use.

 

2. How to install

  Homebrew provides the official website address for installation: https://brew.sh/index_zh-cn

  The main one is a sentence on the homepage, you need to execute it yourself.

  

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

 

  

 

  For such a simple command, is it completely trivial! Then it was carried out with confidence.

 

3. What happened during the installation

  Open your own CMD (terminal) window, and download with anticipation.

  Hey! Service refused link on port 443 (https request)

  

 

  I believe you already know, even if you use direct access: https://raw.githubusercontent.com/Homebrew/install/master

  Also failed to connect and was walled.

 

4. How to solve

  Since it has been walled, or it is just to find a ladder by yourself (outside Baidu in science, watch it civilized), I will not talk about this

  There is also a domestic mirror to download, just found a usable mirror on the Internet, paste it directly here. Source: https://gitee.com/cunkai/HomebrewCN

  note! The script pull address has been replaced here and can be executed directly (that is, step 3)

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

 

  Sure enough, the prompt became friendly. Follow the prompts all the way down.

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

              Start to execute the automatic Brew installation program 
             [cunkai.wang@foxmail .com] 
           [ 2020 - 04 - . 19  00 : 29 : 22 is ] [ 10.14 ] 
       HTTPS: // zhuanlan.zhihu.com/p/111014448 


Please select a download image, e.g. USTC, enter a carriage return. 
The source is sometimes unstable. If git clone reports an error, rerun the script to select the source. cask is not necessary, and some people need it. 
1. Chinese University of Science and Technology download source 2 , Tsinghua University download source 3 , Alibaba download source (cask source is missing) 
Please enter the serial number: 1 
You selected the download source of the University of Science and Technology of China
 ==>Delete the previous brew through the command and create a new Homebrew folder 
(Set the power-on password: Apple icon in the upper left corner- > System Preferences-> " Users and Groups " -> Change Password) 
(If prompted This incident will be reported . Check whether you are an administrator in " Users and Groups " . 
Please enter the power-on password, the input process is not displayed, and press Enter after entering 
: Password:
 -> Create folder / usr / local / Homebrew 
This step is successful
 ==> Before deleting brew environment, re-create
 -> create a folder / usr / local / Caskroom 
this step successfully
 -> create a folder / usr / local / Cellar 
this step successfully
 -> create a folder / usr / local / var / homebrew 
this step is successful
 - > Create folder / usr / local / etc. 
this step is successful-
 > Create folder / usr / local / sbin 
this step is successful
-> Create folder / usr / local / share 
this step is successful-
 > Create folder / usr / local / opt 
this step is successful-
 > Create folder / usr / local / share / zsh 
this step is successful-
 > Create folder / usr / local / share / zsh / site- functions 
This step succeeded-
 > Create folder / usr / local / var / homebrew / linked 
This step succeeded-
 > Create folder / usr / local / Frameworks 
This step succeeded 
git version 2.20 . 1 (Apple Git- 117 ) If the 

download speed is slow, you can ctrl + c to re-run the script to select the download source
 ==> clone Homebrew basic file (32M + ) 

Cloning into ' / usr / local / Homebrew ' ... 
remote: Enumerating objects:134 911 , DONE . 
Remote: the Total 134 911 (Delta 0 ), the Reused 0 (Delta 0 ) 
Receiving Objects: 100 % ( 134 911 / 134 911 ), 32.85 MiB | 235.00 KiB / S, DONE . 
Resolving of deltas: 100 % ( 99 394 / 99 394 ) , done . 
This step succeeded
 ==> Create an alias for brew 
This step succeeded 
No Git agent found (in normal state)
 ==> Clone Homebrew Core (224M + ) 
If Password is displayed here, it means that you need to enter the power-on password again. car 
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Enumerating objects: 708061, done.
remote: Total 708061 (delta 0), reused 0 (delta 0)B | 1.00 MiB/s      
Receiving objects: 100% (708061/708061), 229.28 MiB | 709.00 KiB/s, done.
Resolving deltas: 100% (469820/469820), DONE.
Files OUT Checking: 100 % ( 5196 / 5196 ), DONE . 
This step successfully
 ==> Cask cloning the Homebrew (248M + ) Similarly AppStore 
here represented Password If the power required to enter the password again, after the input Enter 
Password: 
Cloning INTO ' / usr / local / Homebrew / Library / Taps / homebrew / homebrew-cask ' ... 
remote: Enumerating objects: 426904 , done . 
remote: Total 426904 (delta 0 ), reused 0 (delta 0 ) B | 991.00 KiB / s     
Receiving objects: 100% ( 426 904 / 426 904 ), 260.20 MiB | 679.00 KiB / S, DONE . 
Resolving deltas: 100 % ( 304 780 / 304 780 ), DONE . 
This step success
 ==> Configure domestic Download 
Password: 
This step success

 ==> the installation is complete , Brew version 

detects that your system is old, there will be some errors, please wait for Ruby to download and install; 
    
brew - v

 -e: 1 : in `<main> ' : undefined method` canonical_segments '  for # <Gem :: Version " 2.3.7 " > (NoMethodError)
==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles-portable-ruby/portable-ruby-2.6.3.mavericks.bottle.tar.gz
######################################################################## 100.0%
==> Pouring portable-ruby-2.6.3.mavericks.bottle.tar.gz
Homebrew 2.2.13-44-g80eda90-dirty
Homebrew/homebrew-core (git revision 43181; last commit 2020-04-15)
Homebrew/ homebrew-Cask (git Revision eea22; Last the commit 2020 - 04 - 16 ) 
Brew pre-configured successfully

 ==> BREW Update 

Already up -to- DATE . 

        On one up if prompted Already -to- DATE indicates success 
            Brew automatically run the installation program Completion The 
              domestic address has been configured. 

                Initial introduction of several brew commands. 

        Local software library list: brew ls 
        search software: brew search google (where google is replaced with the software keyword to be searched) 
        View brew version: brew - v Update brew version: brew update 

        Formulae (program library such as python) 
        installs the program library: brew install curl (where curl is replaced with the name of the software library to be installed)
        Uninstall solution library: brew uninstall curl (where curl is replaced with the name of the software library to be uninstalled) 

        Casks (interface software such as Google Chrome) 
        Install software: brew cask install visual-studio-code (where visual-studio-code is replaced with the installed one Software name, such as google- chrome) 
        Uninstall the software: brew cask uninstall visual -studio-code (where visual-studio-code is replaced with the name of the software to be uninstalled, such as google- chrome) 

        Find the location where the command is installed: which brew (brew can Change to any command, including brew installation) 

Now you can enter the command open ~ / .zshrc or open ~ / .bash_profile to sort out the repeated statements (run echo $ SHELL to see which file should be opened for modification) 

        https: // zhuanlan. zhihu.com/p/111014448 Welcome to 
    
like xiaobai: etc bai $ brew 
Example usage: 
  brew search [TEXT | / REGEX / ]
  brew info [FORMULA...]
  brew install FORMULA...
  brew update
  brew upgrade [FORMULA...]
  brew uninstall FORMULA...
  brew list [FORMULA...]

Troubleshooting:
  brew config
  brew doctor
  brew install --verbose --debug FORMULA

Contributing:
  brew create [URL [--no-fetch]]
  brew edit [FORMULA...]

Further help:
  brew commands
  brew help [COMMAND]
  man brew
  https://docs.brew.sh
xiaobai:etc bai$ 

 

 

  

 

Guess you like

Origin www.cnblogs.com/china-baizhuangli/p/12729494.html
Recommended