今天為了要在 Mac OS X 裡安裝 Docker 環境,所以打算用 Homebrew 來做相關安裝,首先就是先更新一下 Homebrew 的清單 formulas..

下了指令 $ brew update

 

結果跑出從來沒見過的一大串錯誤訊息出來..

error: Your local changes to the following files would be overwritten by merge:
.yardopts
CODEOFCONDUCT.md
LICENSE.txt
Library/Contributions/brew_fish_completion.fish
Library/Contributions/brew_zsh_completion.zsh
Library/Contributions/example-formula.rb
Library/ENV/4.3/bsdmake
Library/ENV/4.3/cc
Library/Formula/a2ps.rb
Library/Formula/abcde.rb
Library/Formula/abcm2ps.rb
Library/Formula/abcmidi.rb
Library/Formula/abnfgen.rb
Library/Formula/ace.rb
Library/Formula/ack.rb
Library/Formula/acme.rb
Library/Formula/acpica.rb
Library/Formula/activemq.rb
Library/Formula/adobe-air-sdk.rb
Library/Formula/aescrypt.rb
Library/Formula/afflib.rb
Library/Formula/afsctool.rb
Library/Formula/align.rb
Library/Formula/amtterm.rb
Library/Formula/android-ndk.rb
Library/Formula/android-platform-tools.rb
Library/Formula/android-sdk.rb
Library/Formula/ansible.rb
Library/Formula/ant.rb
Library/Formula/antlr.rb
Library/Formula/apache-spark.rb
Library/Formula/apgdiff.rb
Library/Formula/apib.rb
Library/Formula/app-engine-java-sdk.rb
Library/Formula/appscale-tools.rb
Library/Formula/aqbanking.rb
Library/Formula/arangodb.rb
Library/Formula/aria2.rb
Library/Formula/asciidoc.rb
Library/Formula/aspell.rb
Library/Formula/assimp.rb
Library/Formula/astyle.rb
Library/Formula/at-spi2-core.rb
Library/Formula/atomicparsley.rb
Library/Formula/atool.rb
Library/Formula/ats2-postiats.rb
Library/Formula/aubio.rb
Library/Formula/auctex.rb
Library/Formula/audiofile.rb
Library/Formula/augeas.rb
Library/Formula/auto-scaling.rb
Library/Formula/autoconf.rb
Library/Formula/autoenv.rb
Library/Formula/autogen.rb
Library/Formula/autojump.rb
Library/Formula/automake.rb
Library/Formula/avfs.rb
Library/Formula/avian.rb
Library/Formula/avidemux.rb
Library/Formula/avra.rb
Library/Formula/aws-cfn-tools.rb
Library/Formula/aws-elasticache.rb
Library/Formula/aws-elasticbeanstalk.rb
Library/Formula/aws-sns-cli.rb
Library/Formula/awscli.rb
Library/Formula/axel.rb
Library/Formula/b43-fwcutter.rb
Library/Formula/babeld.rb
Library/Formula/bacula-fd.rb
Library/Formula/bam.rb
Library/Formula/bar.rb
Library/Formula/bash-git-prompt.rb
Library/Formula/bash.rb
Library/Formula/bashdb.rb
Library/Formula/bashish.rb
Library/Formula/bats.rb
Library/Formula/bazaar.rb
Library/Formula/bbftp-client.rb
Library/Formula/bchunk.rb
Library/Formula/bcpp.rb
Library/Formula/bcrypt.rb
Library/Formula/beecrypt.rb
Library/Formula/bfg.rb
Library/Formula/bib-tool.rb
Library/Formula/bibtex2html.rb
Library/Formula/bibutils.rb
Library/Formula/bind.rb
Library/Formula/binutils.rb
Library/Formula/binwalk.rb
Library/Formula/bison.rb
Library/Formula/bitchx.rb
Library/Formula/blink1.rb
Library/Formula/blitz.rb
Library/Formula/blueutil.rb
Library/Formula/bmon.rb
Library/Formula/boost-bcp.rb
Library/Formula/boost-build.rb
Library/Formula/boost-python.rb
Library/Formula/boost.rb
Library/Formula/boot2docker.rb
Library/Formula/boxes.rb
Library/Formula/bpm-tools.rb
Library/Formula/bro.rb
Library/Formula/bsdiff.rb
Library/Formula/buildapp.rb
Library/Formula/bup.rb
Library/Formula/burp.rb
Library/Formula/bvi.rb
Library/Formula/c-ares.rb
Library/Formula/cabal-install.rb
Library/Formula/cabextract.rb
Library/Formula/cairo.rb
Library/Formula/cairomm.rb
Library/Formula/capnp.rb
Library/Formula/capstone.rb
Library/Formula/cassandra.rb
Library/Formula/caudec.rb
Library/Formula/cc65.rb
Library/Formula/ccache.rb
Library/Formula/ccextractor.rb
Library/Formula/ccm.rb
Library/Formula/cdparanoia.rb
Library/Formula/cdrdao.rb
Library/Formula/cdrtools.rb
Library/Formula/cfengine.rb
Library/Formula/cgal.rb
Library/Formula/cgdb.rb
Library/Formula/cgrep.rb
Library/Formula/cheat.rb
Library/Formula/checkbashisms.rb
Library/Formula/cherokee.rb
Library/Formula/chibi-scheme.rb
Library/Formula/chktex.rb
Library/Formula/chromedriver.rb
Library/Formula/chruby.rb
Library/Formula/chuck.rb
Library/Formula/clamav.rb
Library/Formula/clasp.rb
Library/Formula/clhep.rb
Library/Formula/clib.rb
Library/Formula/clojurescript.rb
Library/F
error: The following untracked working tree files would be overwritten by merge:
Library/.rubocop.yml
Library/Aliases/cmark
Library/Aliases/libgme
Library/Aliases/nim
Library/Aliases/yubikey-personalization
Library/ENV/pkgconfig/10.10/sqlite3.pc
Library/ENV/pkgconfig/10.10/zlib.pc
Library/ENV/pkgconfig/10.6/sqlite3.pc
Library/ENV/pkgconfig/10.6/zlib.pc
Library/ENV/pkgconfig/10.7/sqlite3.pc
Library/ENV/pkgconfig/10.7/zlib.pc
Library/ENV/pkgconfig/10.8/sqlite3.pc
Library/ENV/pkgconfig/10.8/zlib.pc
Library/ENV/pkgconfig/10.9/sqlite3.pc
Library/ENV/pkgconfig/10.9/zlib.pc
Library/Formula/abi-compliance-checker.rb
Library/Formula/afl-fuzz.rb
Library/Formula/agda.rb
Library/Formula/apr-util.rb
Library/Formula/apr.rb
Library/Formula/arpon.rb
Library/Formula/asciinema.rb
Library/Formula/baresip.rb
Library/Formula/blucat.rb
Library/Formula/bwctl.rb
Library/Formula/carthage.rb
Library/Formula/cctools.rb
Library/Formula/chapel.rb
Library/Formula/chinadns-c.rb
Library/Formula/clang-format.rb
Library/Formula/commonmark.rb
Library/Formula/cpp-netlib.rb
Library/Formula/crystax-ndk.rb
Library/Formula/ctunnel.rb
Library/Formula/davmail.rb
Library/Formula/deis.rb
Library/Formula/distribution.rb
Library/Formula/dnscrypt-wrapper.rb
Library/Formula/dsd.rb
Library/Formula/duck.rb
Library/Formula/ebook-tools.rb
Library/Formula/epeg.rb
Library/Formula/euler-py.rb
Library/Formula/fabric.rb
Library/Formula/ffe.rb
Library/Formula/ffts.rb
Library/Formula/flow.rb
Library/Formula/galen.rb
Library/Formula/game-music-emu.rb
Library/Formula/gauge.rb
Library/Formula/gdnsd.rb
Library/Formula/gifify.rb
Library/Formula/git-review.rb
Library/Formula/gitfs.rb
Library/Formula/glbinding.rb
Library/Formula/gtkextra.rb
Library/Formula/h2o.rb
Library/Formula/i2util.rb
Library/Formula/icdiff.rb
Library/Formula/id3ed.rb
Library/Formula/iojs.rb
Library/Formula/jooby-bootstrap.rb
Library/Formula/julius.rb
Library/Formula/juman.rb
Library/Formula/kore.rb
Library/Formula/lcab.rb
Library/Formula/libbpg.rb
Library/Formula/libforensic1394.rb
Library/Formula/libgit2-glib.rb
Library/Formula/libgxps.rb
Library/Formula/libhdhomerun.rb
Library/Formula/libjson-rpc-cpp.rb
Library/Formula/libpointing.rb
Library/Formula/libsoxr.rb
Library/Formula/lsh.rb
Library/Formula/ltl2ba.rb
Library/Formula/mdk.rb
Library/Formula/memo.rb
Library/Formula/mitie.rb
Library/Formula/mpw.rb
Library/Formula/mvnvm.rb
Library/Formula/mysql-sandbox.rb
Library/Formula/nave.rb
Library/Formula/nikto.rb
Library/Formula/odo.rb
Library/Formula/odt2txt.rb
Library/Formula/open-zwave.rb
Library/Formula/openh264.rb
Library/Formula/openwsman.rb
Library/Formula/pcsc-lite.rb
Library/Formula/pgcli.rb
Library/Formula/pwntools.rb
Library/Formula/queequeg.rb
Library/Formula/rbenv-bundle-exec.rb
Library/Formula/rbenv-bundler-ruby-version.rb
Library/Formula/redpen.rb
Library/Formula/redshift.rb
Library/Formula/restund.rb
Library/Formula/rocket.rb
Library/Formula/sblim-sfcc.rb
Library/Formula/simple-amqp-client.rb
Library/Formula/smali.rb
Library/Formula/snappystream.rb
Library/Formula/sourcekitten.rb
Library/Formula/speech-tools.rb
Library/Formula/spoof-mac.rb
Library/Formula/src.rb
Library/Formula/stash-cli.rb
Library/Formula/stoken.rb
Library/Formula/stormssh.rb
Library/Formula/synscan.rb
Library/Formula/tippecanoe.rb
Library/Formula/ucommon.rb
Library/Formula/unarj.rb
Library/Formula/vavrdiasm.rb
Library/Formula/vnu.rb
Library/Formula/vpcs.rb
Library/Formula/wakatime-cli.rb
Library/Formula/wellington.rb
Library/Formula/whereami.rb
Library/Formula/wsmancli.rb
Library/Homebrew/cmd/style.rb
Library/Homebrew/requirements/apr_dependency.rb
Library/Homebrew/test/fixtures/test.ico
Library/Homebrew/test/fixtures/test.mp3
Please move or remove them before you can merge.
Aborting
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master

 

這個狀況是從來沒遇到過的,為何 Homebrew 無法更新?

 

這時最好的方式就是透過 Google 大神來查一下解決方式,網頁上出現一堆連結,看來這個問題已經是常見方式,看了幾個討論的頁面,每個人回答解決方式都不同,所以耐心的一一檢視每一個解決方式,終於在 github 裡的 homebrew 官方討論區裡,見到有位高手的解決方式。

因為 brew 無法從官方的 git 上抓下 formulas 到 local 端而造成的錯誤,因此只要依序執行以下程序,重新修正就可以解決這個問題了!


$ cd `brew --prefix`
$ git remote add origin https://github.com/mxcl/homebrew.git
$ git fetch origin
$ git reset --hard origin/master

 

果然還是得拜這些神人的幫助才能解決問題。


參考資料討論連結
https://github.com/Homebrew/homebrew/issues/11448

 

 

文章標籤
創作者介紹

Martin的世界

wjhwang 發表在 痞客邦 PIXNET 留言(0) 人氣()