Homebrew installation and use
Homebrew installation
Enter the following command on the Mac terminal and wait for the installation to complete
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Error after installing homebrew - bash: brew: command not found solution
In fact, solving this problem is really simple. As follows:
vim ~/.bash_profile
Add the following line
export PATH=/usr/local/bin:$PATH
Save and execute the following command to make the configuration effective
source ~/.bash_profile
Reopen the command line tool and use the brew command again
Homebrew basic usage
Install any package
$ brew install <package_name>
Uninstall any package
$ brew uninstall <packageName>
Update the package directory of Homebrew on the server side
$ brew update
See if your package needs to be updated
$ brew outdated
Update package
$ brew upgrade <package_name>
Query available packages
$ brew search <packageName>
View the list of packages you have installed (including version number)
$ brew list --versions
View any package information
$ brew info <packageName>
View help information
$ brew -h
Homebrew will cache the old version of the package so that you can use it when you want to roll back to the old version. However, it is rarely used. When you want to clean up the package cache of the old version, you can run:
$ brew cleanup
Homebrew image
Since the Homebrew download source is basically abroad, the download speed of developers in China may be relatively slow. To solve this problem, some people have made a Homebrew image for domestic developers, such as http://ban.ninja/
Configure mirror source
Setting the environment variable HOMEBREW_BOTTLE_DOMAIN can use this image source to accelerate the download of Homebrew resources.
bash
Open ~ / bashrc
sudo vim ~/.bashrc
At ~ / Add in bashrc
export HOMEBREW_BOTTLE_DOMAIN=http://7xkcej.dl1.z0.glb.clouddn.com
explain
This image source only mirrors the binary precompiled packages hosted by Homebrew on binray, so it only has the acceleration function for these binary packages (Homebrew uses this channel to download and install software in most cases).
Homebrew Cask
Homebrew Cask is maintained by the community, so it has more and richer software. We can install and manage OS X graphical interface programs gracefully, simply and quickly through Homebrew Cask, such as Google Chrome and Evernote.
install
Installing homebrew cask is so simple and direct that you can complete it by running the following command:
$ brew tap caskroom/cask // Add the caskroom/cask library on Github $ brew install brew-cask // Install brew cask $ brew update && brew upgrade brew-cask && brew cleanup // to update $ brew cask install google-chrome // Install Google browser
search
If you want to check whether the app you need exists on the cask, you can go to caskroom.io Search.
File preview plug-in
Some plug-in unit It can make file preview on Mac more effective, such as syntax highlighting, markdown rendering, json preview and so on.
$ brew cask install qlcolorcode $ brew cask install qlstephen $ brew cask install qlmarkdown $ brew cask install quicklook- json $ brew cask install qlprettypatch $ brew cask install quicklook-csv $ brew cask install betterzipql $ brew cask install webp-quicklook $ brew cask install suspicious- package
OS X graphical interface program
$ brew cask install alfred $ brew cask install appcleaner $ brew cask install cheatsheet $ brew cask install dropbox $ brew cask install google-chrome $ brew cask install onepassword $ brew cask install sublime- text $ brew cask install totalfinder ...
Cakebrew
Graphical interface tool for Homebrew under Mac Cakebrew
install
$ brew cask install cakebrew
If you can't download it, go directly to Official website Download the dmg package for installation
Article reprinted from: https://blog.csdn.net/plpldog/article/details/81271663