MAC必装软件之HomeBrew、HomeBrew-Cask
MAC必装软件之HomeBrew
- 安装
- brew命令
- HomeBrew-cask 安装
- HomeBrew Cask常用命令
安装
1.拉取脚本
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install
2.更改脚本中的资源链接
BREW_REPO = “https://github.com/Homebrew/brew“.freeze
更改为:
BREW_REPO = “https://mirrors.ustc.edu.cn/brew.git “.freeze
注意: 新版本HomeBrew可能没有CORE_TAP_REPO这句代码,如果没有不用新增。 如果这个镜像有问题的话,可以换成其他源。
3.执行脚本
/usr/bin/ruby brew_install
4.然后把homebrew-core的镜像地址也设为中科院的国内镜像
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
5.执行更新
brew update --verbose
6.检查无错误,就算完成了。
brew doctor
7.直接使用 Homebrew 还需要更改默认源
替换核心软件仓库
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
替换 cask 软件仓库
cd "$(brew --repo)"/Library/Taps/caskroom/homebrew-cask
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
替换 Bottles 源
1、bash(默认 shell)用户:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
2、用户:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc
brew命令
1.安装
brew install wget
2.查看软件包信息
brew info wget
3.搜索软件
brew search wget
4.更新所有软件
brew update
5.卸载软件
brew uninstall wget
6.更新特定软件
brew upgrade wget
7.查看所有以安软件
brew list
8.查看需要更新的软件
brew outdated
9.现实包依赖
brew reps
10.帮助
brew help
HomeBrew-cask 安装
1.安装brew-cask
brew install brew-cask-completion
2.检查是否安装cask
brew cask
3.出现help信息表示安装成功
Commands:
--cache display the file used to cache the Cask
audit verifies installability of Casks
cat dump raw source of the given Cask to the standard output
create creates the given Cask and opens it in an editor
doctor checks for configuration issues
edit edits the given Cask
fetch downloads remote application files to local cache
home opens the homepage of the given Cask
info displays information about the given Cask
install installs the given Cask
list with no args, lists installed Casks; given installed Casks, lists staged files
outdated list the outdated installed Casks
reinstall reinstalls the given Cask
style checks Cask style using RuboCop
uninstall uninstalls the given Cask
upgrade upgrades all outdated casks
zap zaps all files associated with the given Cask
HomeBrew Cask常用命令
1.搜索app
brew cask info qqmusic
2.安装app
brew cask install qqmusic
3.app列表
brew cask list
4.更新app
brew cask upgrade
或者
brew cask upgrade qqmusic
推荐第二种
5.卸载app
brew cask uninstall qqmusic
6.了解更多操作
brew cask
还没有评论,来说两句吧...