欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Homebrew 的Checksum mismatch错误

程序员文章站 2024-02-26 14:36:22
...

    Homebrew是Mac系统中一款比较著名的软件包管理工具,该工具可以方便用户安装、维护和卸载Mac系统下的各种软件。Homebrew的安装非常简单,但是由于偶尔的网络故障,很可能会导致Checksum mismatch错误。

    安装仅需一条命令,过程如下:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

    如果上述安装过程没有顺利完成,则需要重新运行命令,重复运行命令时则可能会出现Checksum mismatch错误,如下所示:

==> You are using macOS 10.10.
==> We (and Apple) do not provide support for this old version.
This installation may not succeed.
After installation, you will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Discourse, Twitter or IRC. You are responsible for resolving any issues you
experience while you are running this old version.

==> 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

Press RETURN to continue or any other key to abort
==> Downloading and installing Homebrew...
HEAD is now at d4fc6d5 Merge pull request #6971 from issyl0/linux-bump-formula-handles-bottle-sha
/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: warning: unknown argument for --enable: `frozen-string-literal'
/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: warning: unknown argument for --disable: `did_you_mean'
==> Downloading https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.6.3.mavericks.bottle.tar.gz
Already downloaded: /Users/hoho/Library/Caches/Homebrew/portable-ruby-2.6.3.mavericks.bottle.tar.gz
Error: Checksum mismatch.
Expected: ab81211a2052ccaa6d050741c433b728d0641523d8742eef23a5b450811e5104
  Actual: 8e587089de7b9329ba72360836ed7b21d63a1fa53e2473c9e183560614b02781
 Archive: /Users/hoho/Library/Caches/Homebrew/portable-ruby-2.6.3.mavericks.bottle.tar.gz
To retry an incomplete download, remove the file above.
Error: Failed to install vendor Ruby.
Failed during: /usr/local/bin/brew update --force
testdeMacBook-Pro:Desktop hoho$ cd /Users/hoho/Library/Caches/Homebrew
testdeMacBook-Pro:Homebrew hoho$ ls
portable-ruby-2.6.3.mavericks.bottle.tar.gz

    此时,你只需要按照要求,删掉出现错误的软件包就可以了。从上面的信息来看,/Users/hoho/Library/Caches/Homebrew/该目录下的portable-ruby-2.6.3.mavericks.bottle.tar.gz 的校验和出现了错误。只需进入该目录,删掉该软件包即可。

$ cd /Users/hoho/Library/Caches/Homebrew/
$ rm -rf portable-ruby-2.6.3.mavericks.bottle.tar.gz 
相关标签: 问题汇总