[Solved] Curl: (22) the requested URL returned error: 404 when installing XXX on MAC brew

There are two solutions:

Solution 1:
(solved through method 1)
Update brew directly
brew update method 2:
(the experiment in method 2 failed)
modify the environment variable:

brew config # Find
## Find: 
HOMEBREW_BOTTLE_DOMAIN:https://mirrors.ustc.edu.cn/homebrew-bottles

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

source ~/.zshrc

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

Read More: