折腾:
期间,参考教程:
先去:
brew update
结果出错:
<code>➜ ~ brew update error: Unable to get pack file https://mirrors.ustc.edu.cn/brew.git/objects/pack/pack-6660066080302638c0e2d738133dea4d21aedd72.pack The requested URL returned error: 416 Requested Range Not Satisfiable error: Unable to find c1cab8a24d63593baeea0bff65fc0b0e5d2324c1 under https://mirrors.ustc.edu.cn/brew.git Cannot obtain needed object c1cab8a24d63593baeea0bff65fc0b0e5d2324c1 error: fetch failed. Error: Fetching /usr/local/Homebrew failed! </code>
brew update error Unable to get pack file
brew update error Unable to get pack file mirrors.ustc.edu.cn
OSX 10.11下Homebrew的安装问题 – 鸟海无涯 – 博客园
problem with brew update · Issue #44886 · Homebrew/legacy-homebrew
Cannot “brew update” anymore – fails to git pull formulas · Issue #11448 · Homebrew/legacy-homebrew
Homebrew Core 源使用帮助 — USTC Mirror Help 文档
用国内的源(Source)替换官方源,提高下载速度(包括Homebrew, npm 和 Composer 等) – Neo’s Blog
结果过了会发现:
<code>➜ ~ brew update error: Unable to get pack file https://mirrors.ustc.edu.cn/brew.git/objects/pack/pack-6660066080302638c0e2d738133dea4d21aedd72.pack The requested URL returned error: 416 Requested Range Not Satisfiable error: Unable to find c1cab8a24d63593baeea0bff65fc0b0e5d2324c1 under https://mirrors.ustc.edu.cn/brew.git Cannot obtain needed object c1cab8a24d63593baeea0bff65fc0b0e5d2324c1 error: fetch failed. Error: Fetching /usr/local/Homebrew failed! Updated 1 tap (homebrew/core). ==> New Formulae amber dnsdist hss massren rsync-time-backup apm-server docker-ls htslib maxwell rtptools arcade-learning-environment docker-squash icemon mdcat samtools arm-linux-gnueabihf-binutils dps8m igv mecab-unidic-extended sc-im asciidoctor draco inspectrum mill sceptre asciidoctorj duc iron-functions mmseqs2 seqtk ask-cli dvanalyzer jabba monero shelltestrunner auditbeat dynare jdupes mongodb@3.4 shogun augustus e2tools joplin mpir sickle autopep8 elasticsearch@5.6 jthread mrboom simg2img avimetaedit elektra just msgpuck singular ballerina envconsul kaitai-struct-compiler neal siril bamtools fastme kallisto neomutt skaffold bareos-client fastqc kedge node@8 skafos bcal fbi-servefiles keystone nopoll spades bcftools fcl kibana@5.6 nyx sratoolkit bedops field3d kontena ocaml-findlib srt bedtools flintrock krakend ocaml-num ssh-vault bench fruit kube-ps1 ocrmypdf stellar-core bioawk fselect kubeless octomap stress-ng blast futhark kumo odpi swift-protobuf boost-python3 gdcm lammps opencascade telnetd bwa genometools landscaper openimageio terraform_landscape bwfmetaedit ghc@8.2 latexdiff orocos-kdl terraforming bzt gifski lgogdownloader parallelstl tj caffe git-appraise libbi pdfpc tmux-xpanes calicoctl git-sizer libbitcoin-consensus picard-tools tnftp chamber glances libbitcoin-database pinboard-notes-backup tnftpd chrome-export glib-openssl libbitcoin-network pipenv tomcat@8 clac glslviewer libbitcoin-node plank traefik clblast go-bindata libbitcoin-server posh travis cling go-jira libccd postgresql@9.6 unravel clingo go-statik libdill precomp urdfdom console_bridge go@1.9 libidn2 primer3 urdfdom_headers container-diff gocryptfs libjwt prodigal vcftools coreos-ct google-authenticator-libpam libomp pspg vert cp2k goto libsbol python@2 vis crc32c gox libserialport qpid-proton visp csvkit gpredict libtomcrypt qtkeychain webtorrent-cli darksky-weather grv libxo quicktype wp-cli dartsim gtksourceview@4 llvm@5 rawtoaces ydcv dashing gutenberg lm4tools raylib ykman ddgr heartbeat lmod rbenv-chefdk yq defaultbrowser hlint lzfse restic zig diamond hmmer mafft restview zip dislocker howdoi mariadb-connector-odbc rst-lint ==> Updated Formulae abcde elasticsearch idutils mpfi sassc abcm2ps elixir imagemagick mpfr saxon abcmidi elm imagemagick@6 mpg123 sbcl 。。。 saltstack </code>
ejabberd idris mpdas sane-backends
==> Renamed Formulae
camlistore -> perkeep mobile-shell -> mosh tachyon -> alluxio
findbugs -> spotbugs newsbeuter -> newsboat thrift@0.90 -> thrift@0.9
gitlab-ci-multi-runner -> gitlab-runner php72 -> php
httpd24 -> httpd ssreflect -> math-comp
==> Deleted Formulae
angolmois go@1.6 libpng@1.2 python3 ✔
antlr@3 go@1.7 libpqxx@3 qt@5.7
apache-spark@1.5 grails@2.5 libxml2@2.7 redis@2.6
apache-spark@1.6 gringo litmus rexster
autoconf@2.64 gsl@1 llvm@3.8 rexster-console
automake@1.12 gst-plugins-bad@0.10 logstash@2.4 root@5
azure-cli@1 gst-plugins-base@0.10 lua@5.3 ruby@1.9
bazel@0.2 gst-plugins-good@0.10 mal4s ruby@2.1
clang-format@3.8 gst-plugins-ugly@0.10 mg3a selenium-server-standalone@2.45
clasp gstreamer@0.10 mimetic solr@5.4
cloog@0.15 htop-osx mongodb@2.6 srtp@1.6
cloudbees-sdk influxdb@0.8 moodbar stklos
clozure-cl isl@0.11 mpfr@2 swig@2
docker@1.11 isl@0.12 mvptree talk-filters
docker@1.71 isl@0.14 nazghul tcpurify
eigen@3.2 jboss-as open-mpi@1.6 tomcat@8.0
elixirscript jboss-as@5 otto ufoai
gcc@4.6 jetty@8 pcap_dnsproxy unison@2.40
gcc@4.7 jpeg@6 percona-server@5.5 voltdb
gcc@4.8 juju@1.25 perl@5.14 zeromq@3.2
geogit kubernetes-cli@1.3 picolisp zeromq@4.0
glfw@2 ledger@2.6 pond zeromq@4.1
gmp@4 libical-glib ponscripter-sekai
go@1.5 libmpc@0.8 ppl@0.11
==> Migrating python3 to python
==> Unlinking python3
==> Unlinking python
==> Moving python3 children
==> Linking python
貌似全部更新完毕了?
算了,暂时不管了。
结果后面又出错:
<code>➜ ~ brew install mongodb Error: go: version missing for "gotools" resource! </code>
brew install Error go version missing for “gotools” resource
go: version missing for “gotools” resource! · Issue #19221 · Homebrew/homebrew-core
Unable to install/uninstall Go · Issue #19236 · Homebrew/homebrew-core
<code>➜ ~ brew doctor Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry and just ignore them. Thanks! Warning: Suspicious Homebrew/brew git origin remote found. With a non-standard origin, Homebrew won't pull updates from the main repository. The current git origin is: https://mirrors.ustc.edu.cn/brew.git Unless you have compelling reasons, consider setting the origin remote to point at the main repository by running: git -C "/usr/local/Homebrew" remote set-url origin https://github.com/Homebrew/brew.git Warning: Suspicious homebrew/core git origin remote found. With a non-standard origin, Homebrew won't pull updates from the main repository. The current git origin is: https://mirrors.ustc.edu.cn/homebrew-core.git Unless you have compelling reasons, consider setting the origin remote to point at the main repository by running: git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" remote set-url origin https://github.com/Homebrew/homebrew-core.git Warning: Unbrewed dylibs were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected dylibs: /usr/local/lib/librtmp.dylib Warning: Unbrewed header files were found in /usr/local/include. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected header files: /usr/local/include/node/v8-platform.h /usr/local/include/node/uv-posix.h /usr/local/include/node/v8-version.h /usr/local/include/node/node_api_types.h /usr/local/include/node/node_version.h /usr/local/include/node/libplatform/libplatform.h /usr/local/include/node/libplatform/libplatform-export.h /usr/local/include/node/libplatform/v8-tracing.h /usr/local/include/node/v8-inspector-protocol.h /usr/local/include/node/ares_version.h /usr/local/include/node/v8-testing.h /usr/local/include/node/node_buffer.h /usr/local/include/node/v8-profiler.h /usr/local/include/node/uv-unix.h /usr/local/include/node/v8.h /usr/local/include/node/uv-threadpool.h /usr/local/include/node/pthread-fixes.h /usr/local/include/node/uv.h /usr/local/include/node/uv-win.h /usr/local/include/node/v8-util.h /usr/local/include/node/ares.h /usr/local/include/node/uv-aix.h /usr/local/include/node/uv-errno.h /usr/local/include/node/tree.h /usr/local/include/node/node.h /usr/local/include/node/uv-os390.h /usr/local/include/node/v8-debug.h /usr/local/include/node/uv-sunos.h /usr/local/include/node/node_api.h /usr/local/include/node/android-ifaddrs.h /usr/local/include/node/uv-version.h /usr/local/include/node/uv-darwin.h /usr/local/include/node/uv-bsd.h /usr/local/include/node/zlib.h /usr/local/include/node/node_object_wrap.h /usr/local/include/node/nameser.h /usr/local/include/node/stdint-msvc2008.h /usr/local/include/node/v8-value-serializer-version.h /usr/local/include/node/openssl/pem2.h /usr/local/include/node/openssl/pem.h /usr/local/include/node/openssl/ssl3.h /usr/local/include/node/openssl/ossl_typ.h /usr/local/include/node/openssl/dtls1.h /usr/local/include/node/openssl/err.h /usr/local/include/node/openssl/bn.h /usr/local/include/node/openssl/blowfish.h /usr/local/include/node/openssl/cms.h /usr/local/include/node/openssl/engine.h /usr/local/include/node/openssl/conf_api.h /usr/local/include/node/openssl/x509.h /usr/local/include/node/openssl/asn1_mac.h /usr/local/include/node/openssl/ui.h /usr/local/include/node/openssl/kssl.h /usr/local/include/node/openssl/sha.h /usr/local/include/node/openssl/symhacks.h /usr/local/include/node/openssl/asn1.h /usr/local/include/node/openssl/opensslconf.h /usr/local/include/node/openssl/bio.h /usr/local/include/node/openssl/rc2.h /usr/local/include/node/openssl/dh.h /usr/local/include/node/openssl/ui_compat.h /usr/local/include/node/openssl/x509v3.h /usr/local/include/node/openssl/ssl23.h /usr/local/include/node/openssl/conf.h /usr/local/include/node/openssl/md5.h /usr/local/include/node/openssl/x509_vfy.h /usr/local/include/node/openssl/txt_db.h /usr/local/include/node/openssl/safestack.h /usr/local/include/node/openssl/ecdsa.h /usr/local/include/node/openssl/objects.h /usr/local/include/node/openssl/pkcs12.h /usr/local/include/node/openssl/crypto.h /usr/local/include/node/openssl/opensslv.h /usr/local/include/node/openssl/pkcs7.h /usr/local/include/node/openssl/obj_mac.h /usr/local/include/node/openssl/buffer.h /usr/local/include/node/openssl/ssl.h /usr/local/include/node/openssl/srp.h /usr/local/include/node/openssl/camellia.h /usr/local/include/node/openssl/evp.h /usr/local/include/node/openssl/e_os2.h /usr/local/include/node/openssl/md4.h /usr/local/include/node/openssl/hmac.h /usr/local/include/node/openssl/aes.h /usr/local/include/node/openssl/comp.h /usr/local/include/node/openssl/cast.h /usr/local/include/node/openssl/rc4.h /usr/local/include/node/openssl/stack.h /usr/local/include/node/openssl/des.h /usr/local/include/node/openssl/ocsp.h /usr/local/include/node/openssl/ec.h /usr/local/include/node/openssl/ecdh.h /usr/local/include/node/openssl/rand.h /usr/local/include/node/openssl/ts.h /usr/local/include/node/openssl/pqueue.h /usr/local/include/node/openssl/dso.h /usr/local/include/node/openssl/seed.h /usr/local/include/node/openssl/archs/aix-gcc/opensslconf.h /usr/local/include/node/openssl/archs/solaris-x86-gcc/opensslconf.h /usr/local/include/node/openssl/archs/linux-elf/opensslconf.h /usr/local/include/node/openssl/archs/linux64-s390x/opensslconf.h /usr/local/include/node/openssl/archs/solaris64-x86_64-gcc/opensslconf.h /usr/local/include/node/openssl/archs/VC-WIN32/opensslconf.h /usr/local/include/node/openssl/archs/linux-x32/opensslconf.h /usr/local/include/node/openssl/archs/linux-armv4/opensslconf.h /usr/local/include/node/openssl/archs/linux-x86_64/opensslconf.h /usr/local/include/node/openssl/archs/linux-aarch64/opensslconf.h /usr/local/include/node/openssl/archs/aix64-gcc/opensslconf.h /usr/local/include/node/openssl/archs/darwin-i386-cc/opensslconf.h /usr/local/include/node/openssl/archs/darwin64-x86_64-cc/opensslconf.h /usr/local/include/node/openssl/archs/linux-ppc/opensslconf.h /usr/local/include/node/openssl/archs/BSD-x86/opensslconf.h /usr/local/include/node/openssl/archs/VC-WIN64A/opensslconf.h /usr/local/include/node/openssl/archs/linux-ppc64/opensslconf.h /usr/local/include/node/openssl/archs/linux32-s390x/opensslconf.h /usr/local/include/node/openssl/archs/BSD-x86_64/opensslconf.h /usr/local/include/node/openssl/modes.h /usr/local/include/node/openssl/ssl2.h /usr/local/include/node/openssl/rsa.h /usr/local/include/node/openssl/krb5_asn.h /usr/local/include/node/openssl/des_old.h /usr/local/include/node/openssl/ripemd.h /usr/local/include/node/openssl/whrlpool.h /usr/local/include/node/openssl/tls1.h /usr/local/include/node/openssl/mdc2.h /usr/local/include/node/openssl/dsa.h /usr/local/include/node/openssl/srtp.h /usr/local/include/node/openssl/asn1t.h /usr/local/include/node/openssl/cmac.h /usr/local/include/node/openssl/ebcdic.h /usr/local/include/node/openssl/idea.h /usr/local/include/node/openssl/lhash.h /usr/local/include/node/v8config.h /usr/local/include/node/node_internals.h /usr/local/include/node/uv-linux.h /usr/local/include/node/v8-version-string.h /usr/local/include/node/v8-inspector.h /usr/local/include/node/zconf.h /usr/local/include/node/pthread-barrier.h Warning: You have unlinked kegs in your Cellar Leaving kegs unlinked can lead to build-trouble and cause brews that depend on those kegs to fail to run properly once built. Run `brew link` on these: pkg-config wget xz pcre node lrzsz flow Warning: Some installed formula are missing dependencies. You should `brew install` the missing dependencies: brew install gettext libidn2 libunistring Run `brew missing` for more details. ➜ ~ brew missing wget: gettext libunistring libidn2 </code>
然后:
<code>➜ ~ git -C "$(brew --repo)" fetch --tags error: Unable to get pack file https://mirrors.ustc.edu.cn/brew.git/objects/pack/pack-6660066080302638c0e2d738133dea4d21aedd72.pack The requested URL returned error: 416 Requested Range Not Satisfiable error: Unable to find c1cab8a24d63593baeea0bff65fc0b0e5d2324c1 under https://mirrors.ustc.edu.cn/brew.git Cannot obtain needed object c1cab8a24d63593baeea0bff65fc0b0e5d2324c1 error: fetch failed. </code>
错误依旧。
所以还是要解决前面的问题。
brew error: Unable to get pack file
结果:
<code>➜ ~ cd "$(brew --repo)" ➜ Homebrew git:(stable) git fetch error: Unable to get pack file https://mirrors.ustc.edu.cn/brew.git/objects/pack/pack-6660066080302638c0e2d738133dea4d21aedd72.pack The requested URL returned error: 416 Requested Range Not Satisfiable error: Unable to find c1cab8a24d63593baeea0bff65fc0b0e5d2324c1 under https://mirrors.ustc.edu.cn/brew.git Cannot obtain needed object c1cab8a24d63593baeea0bff65fc0b0e5d2324c1 error: fetch failed. </code>
算了:
<code>/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" </code>
<code>➜ Homebrew git:(stable) /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" </code>
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following new directories will be created:
/usr/local/sbin
==> The Xcode Command Line Tools will be installed.
Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir -p /usr/local/sbin
Password:
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/sbin
==> /usr/bin/sudo /bin/chmod 755 /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /usr/sbin/chown crifan /usr/local/sbin
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/sbin
==> /usr/bin/sudo /bin/mkdir -p /Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown crifan /Library/Caches/Homebrew
==> Searching online for the Command Line Tools
==> /usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> Installing Command Line Tools (macOS High Sierra version 10.13) for Xcode-9.2
==> /usr/bin/sudo /usr/sbin/softwareupdate -i Command\ Line\ Tools\ (macOS\ High\ Sierra\ version\ 10.13)\ for\ Xcode-9.2
Software Update Tool
Downloading Command Line Tools (macOS High Sierra version 10.13) for Xcode
Downloaded Command Line Tools (macOS High Sierra version 10.13) for Xcode
Installing Command Line Tools (macOS High Sierra version 10.13) for Xcode
Done with Command Line Tools (macOS High Sierra version 10.13) for Xcode
Done.
==> /usr/bin/sudo /bin/rm -f /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> /usr/bin/sudo /usr/bin/xcode-select –switch /Library/Developer/CommandLineTools
==> Downloading and installing Homebrew…
remote: Counting objects: 7683, done.
remote: Compressing objects: 100% (1960/1960), done.
remote: Total 7683 (delta 5863), reused 7279 (delta 5512), pack-reused 0
Receiving objects: 100% (7683/7683), 1.17 MiB | 686.00 KiB/s, done.
Resolving deltas: 100% (5863/5863), completed with 444 local objects.
From https://github.com/Homebrew/brew
24d74759..c1cab8a2 master -> origin/master
* [new tag] 1.3.5 -> 1.3.5
* [new tag] 1.3.6 -> 1.3.6
* [new tag] 1.3.7 -> 1.3.7
* [new tag] 1.3.8 -> 1.3.8
* [new tag] 1.3.9 -> 1.3.9
* [new tag] 1.4.0 -> 1.4.0
* [new tag] 1.4.1 -> 1.4.1
* [new tag] 1.4.2 -> 1.4.2
* [new tag] 1.4.3 -> 1.4.3
* [new tag] 1.5.0 -> 1.5.0
* [new tag] 1.5.1 -> 1.5.1
* [new tag] 1.5.10 -> 1.5.10
* [new tag] 1.5.11 -> 1.5.11
* [new tag] 1.5.12 -> 1.5.12
* [new tag] 1.5.2 -> 1.5.2
* [new tag] 1.5.3 -> 1.5.3
* [new tag] 1.5.4 -> 1.5.4
* [new tag] 1.5.5 -> 1.5.5
* [new tag] 1.5.6 -> 1.5.6
* [new tag] 1.5.7 -> 1.5.7
* [new tag] 1.5.8 -> 1.5.8
* [new tag] 1.5.9 -> 1.5.9
HEAD is now at c1cab8a2 Merge pull request #3992 from commitay/cask-audit-latest-appcast
==> Cleaning up /Library/Caches/Homebrew…
==> Migrating /Library/Caches/Homebrew to /Users/crifan/Library/Caches/Homebrew…
==> Deleting /Library/Caches/Homebrew…
Already up-to-date.
==> Installation successful!
==> Homebrew has enabled anonymous aggregate user behaviour analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics.html
==> Next steps:
– Run `brew help` to get started
– Further documentation:
brew Unable to get pack file
<code>➜ Homebrew git:(stable) brew update Already up-to-date. </code>
【总结】
此处,最终是用:
<code>/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" </code>
重新安装,解决了问题,再去:
<code>brew update </code>
就正常了。
另外,而之前的源,貌似还是有用的。
转载请注明:在路上 » 【已解决】brew update出错:error: Unable to get pack file mirrors.ustc.edu.cn pack