Mac 下的包安裝管理工具:homebrew
- homebrew 的安裝詳見傳送門,由于 homebrew 的鏡像是國外的,每次下載更新速度較慢、需要翻墻;所以我們可以配置下將鏡像源文件改為國內(nèi)的(此處用的清華大學(xué)的)
vim ~/.bash_profile
echo "export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles" >> ~/.bash_profile
source ~/.bash_profile # 使剛才的配置立即生效
- Homebrew 常用命令:
brew -v
brew update --verbose #觀察update過程
brew info demo #查看demo包的信息
Brew tap xxx 添加源
brew update #更新自己的Homebrew
brew search demo #尋找包名含有demo的包
brew doctor #檢查brew的運(yùn)行狀態(tài)
brew outdates #檢查本機(jī)內(nèi)已經(jīng)處于舊版本的包
brew list #列出brew安裝的包
brew cleanup #清理緩存
brew install demo #安裝demo包
brew uninstall demo #卸載demo包
brew link demo #關(guān)聯(lián)demo包
php -m | grep phalcon #檢測擴(kuò)展
brew -S phalcon #找到對應(yīng)版本的phalcon擴(kuò)展
#修改homebrew鏡像源:
#國內(nèi)清華大學(xué)
echo "export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles" >> ~/.bash_profile
#中科大源
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
#立即生效
source ~/.bash_profile
- 安裝 cakebrew, cakebrew 可理解為 homebrew 的可視化操作工具;
brew cask install cakebrew
20190304
由于
Homebrew/php自來水在2018年3月底被棄用,并將所有 PHP 公式轉(zhuǎn)移到Homebrew/core,舊的brew tap homebrew/dupes、brew tap homebrew/versions、brew tap homebrew/homebrew-php都會報以下錯誤(目前國內(nèi)百度都找不到解決這個問題的方法):
Error: homebrew/php was deprecated. This tap is now empty as all its formulae were migrated.
附上一些參考文章: