There is yum under centOS and apt under ubuntu. I am used to using the package manager to install tools and their dependencies, so Homebrew can be used under mac.
Homebrew official website: http://brew.sh
Execute the command in the terminal to automatically complete the installation:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Common commands:
1. Query: brew search wget or use regular brew search /wget.*/
2. Installation: brew install wget: All installed software is in the /usr/local/Cellar directory, and the corresponding commands are softly linked to /usr/local/bin, check /etc/paths, if /usr/local/ bin is at the top, indicating that the commands in this command are preferentially used by the system for retrieval.
3. Uninstall: brew uninstall wget
4. List all software installed using brew: brew list
5. Update brew: brew update
6. Display dependent packages: brew deps wget #Display dependent packages of wget, such as openssl
7. Display software information: brew info wget
8. List the software installation path: brew list wget #After the installation is complete, it will use a soft link to /usr/local/bin
9. Open the official website of the software with a browser: brew home wget #brew home will open the official website of Homebrew
10. Upgrade software: brew upgrade wget
The github website has a limit on the number of ip accesses. After calling the brew command multiple times, the following error will be prompted:
Error: GitHub API Error: API rate limit exceeded for 114.111.167.230. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.) Try again in 44 minutes 38 seconds, or create a personal access token: https://github.com/settings/tokens/new?scopes=&description=Homebrew and then set the token as: export HOMEBREW_GITHUB_API_TOKEN="your_new_token"
Follow the prompts to visit the corresponding website, register an account, then generate a token and import it into the environment variable.
In addition, when executing the brew update command, the following error is reported:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrunThis is related to upgrading the macOS system. You can execute the command: xcode-select --install, and click Install in the pop-up software installation interface to solve the problem.
In addition, you will also be prompted to authorize the current user at this time: sudo chown -R username /usr/local , after executing brew update, you will be prompted to change back to the original permissions: sudo chown root:wheel /usr/local