解決Mac OSX系統版本安裝brew出錯

2021-07-15 18:31:08 字數 4615 閱讀 3249

字數837

閱讀780

喜歡0

上週更新了最新的mac osx作業系統10.11.x,但是安裝brew命令的時候出現如下兩種錯誤:

fatal: cannot unlink

'library/aliases/0install': permission denied

error: unable to unlink old 'share/doc/homebrew/acceptable-formulae.md' (permission denied)

error: unable to unlink old 'share/doc/homebrew/bottles.md' (permission denied)

error: unable to unlink old 'share/doc/homebrew/brew-test-bot-for-core-contributors.md' (permission denied)

error: unable to unlink old 'share/doc/homebrew/brew-test-bot.md' (permission denied)

error: unable to unlink old 'share/doc/homebrew/c++-standard-libraries.md' (permission denied)

error: unable to create

file

share/doc/homebrew/checksum_deprecation.md (permission denied)

error: unable to unlink old

'share/doc/homebrew/common-issues-for-core-contributors.md' (permission denied)

error: unable to unlink old

'share/doc/homebrew/common-issues.md' (permission denied)

error: unable to unlink old

'share/doc/homebrew/custom-gcc-and-cross-compilers.md' (permission denied)

error: unable to unlink old

'share/doc/homebrew/external-commands.md' (permission denied)

error: unable to unlink old

'share/doc/homebrew/faq.md' (permission denied)

error: unable to unlink old

'share/doc/homebrew/formula-cookbook.md' (permission denied)

error: unable to unlink old

'share/doc/homebrew/gems,-eggs-and-perl-modules.md' (permission denied)

error: unable to unlink old

'share/doc/homebrew/homebrew-and-python.md' (permission denied)

error: unable to unlink old

'share/doc/homebrew/how-to-open-a-homebrew-pull-request-(and-get-it-merged).md' (permission denied)

error: unable to unlink old

'share/doc/homebrew/how-to-create-and-maintain-a-tap.md' (permission denied)

error: unable to unlink old

'share/doc/homebrew/how-to-build-software-outside-homebrew-with-homebrew-keg-only-dependencies.md' (permission denied)

error: unable to unlink old

'share/doc/homebrew/installation.md' (permission denied)

error: unable to unlink old

'share/doc/homebrew/interesting-taps-&-branches.md' (permission denied)

error: unable to

create

file

share/doc/homebrew/kickstarter-supporters.md (permission denied)

error: unable to unlink old

'share/doc/homebrew/maintainer-guidelines.md' (permission denied)

error: unable to unlink old

'share/doc/homebrew/migrating-a-formula-to-a-tap.md' (permission denied)

error: unable to unlink old

'share/doc/homebrew/new-maintainer-checklist.md' (permission denied)

error: unable to unlink old

'share/doc/homebrew/python-for-formula-authors.md' (permission denied)

error: unable to unlink old

'share/doc/homebrew/querying-brew.md' (permission denied)

error: unable to unlink old

'share/doc/homebrew/readme.md' (permission denied)

error: unable to unlink old

'share/doc/homebrew/rename-a-formula.md' (permission denied)

error: unable to unlink old

'share/doc/homebrew/tips-n'-tricks.md' (permission denied)

error: unable to unlink old '

share/doc/homebrew/troubleshooting.md' (permission denied)

error: unable to unlink old '

share/doc/homebrew/xcode.md' (permission denied)

error: unable to unlink old '

share/doc/homebrew/brew-tap.md' (permission denied)

error: unable to unlink old '

share/doc/homebrew/brew.1.html' (permission denied)

fatal: cannot create directory at '

share/doc/homebrew/images': permission denied

網上找了半天找到了此種方法stackoverflow.此方法給我了一些提示,解決了osx系統中brew的安裝。

1.clone brew專案到本地

git clone
2.移動專案檔案

在執行檔案的移動之前,請保證要移動到的目錄檔案中的相同檔案移除

1).通過本地專案可知brew的目錄結構,而我們所使用的命令都是/usr/local/bin檔案中,因此將brew中的bin目錄下的命令brew拷貝或者移動到/usr/local/bin下:(我所使用的是移動)

//進入本地專案brew中

cd brew

//移動brew到系統檔案中

sudo mv bin/brew /usr/local/bin

2).移動library
//移動library庫到/usr/local

sudo library /usr/local

3).移動share檔案
//移動share庫到/usr/local

sudo mv share /usr/local

3.檢視是否安裝成功

使用brew檢視是否已經移動成功.如果有以下內容則代表成功。

到此為止,我們可以執行brew update更新brew,以及brew install來安裝我們所要使用的工具

mac osx系統安裝mongodb遇到的坑

之前用的都是windows電腦沒有那麼多許可權問題 按照菜鳥教程安裝的mongodb 可是用 sudo mongod啟動時 報錯 command not found mongodb 可是配置環境變數後依然不行,然後用 如果沒有建立全域性路徑 path,需要進入以下目錄 cd usr local mo...

嘗試在虛擬機上安裝mac os x系統

目前,最新的版本應該是10.9吧,在網上找到的是10.8 和 10.6 但現在只成功安裝了10。6,遇到的最大問題就是引導的問題,我的系統可能有點特殊,因為我是在64位ubuntu 12。04上面跑vbox4。1的虛擬機器。一般網上介紹的比較多的都是在32位win7上面跑虛擬機器,而且都是以wmwa...

Mac osx 基於系統的MAMP安裝過程

在mac上開發php幾年了,一直都是使用mamp這樣的整合工具 最近出現mamp經常宕機的狀況 或許因為我本機同時開著docker和mamp等工具吧.同時,系統上安裝了各種軟體,各種配置弄得亂糟糟的 反正我系統也重灌備了.brew安裝 nginx phpmysql 這些我都參照的macosx搭建ph...