Mac
的包管理工具基础命令:
brew list --versions
brew outdated
brew update
brew upgrade <package_name>
由于homebrew
会把老版本的包缓存,所以可以使用旧版本.
brew cleanup
brew install <package_name>
例如:
brew install java8
brew
是源代码仓库,所以可以使用它安装homebrew
的核心源brew tap caskroom/cask
--->添加github
上的caskroom/cask
库
brew install brew-cask
--->安装brew-cask
brew update && brew upgrade brew-cask && brew cleanup
--->更新brew
如果失败了记得去到前一章查看配置brew
的环境变量
一些相关插件的安装地址
zsh
zsh
的作用拓展功能和主题.Env.sh
文件用于维护别名(aliases
),输出(exports
)和路径改变(path changes
)等等,以免影响~/.zshrc
homebrew
安装zsh
和zsh completions
安装zsh completions
:
brew install zsh zsh-completions
安装zsh
的拓展(on-my-zsh
):
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
安装成功后修改.zshrc
内容:
sudo vim .zshrc
添加以下内容:
ZSH_THEME=pygmalion alias zshconfig="vi ~/.zshrc" alias envconfig="vi ~/Projects/config/env.sh" plugins=(git colored-man colorize github jira vagrant virtualenv pip python brew osx zsh-syntax-highlighting)
注意:
新增或者修改环境变量都需要重新刷新一下 --->resource
删除一个环境变量必须退出当前的teminal
,然后在重新打开一个teminal
--->exit
homebrew
使用如下指令:
/bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/uninstall.sh)"