首页 > 解决方案 > 无法使用 brew 安装任何东西,错误:无法下载资源“git--html”

问题描述

每当我尝试运行brew install <app>时,例如brew install git,我都会收到以下错误:

$ brew install git
Updating Homebrew...
Warning: You are using macOS 10.10.
We (and Apple) do not provide support for this old version.
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.

==> Downloading https://ftp.gnu.org/gnu/gettext/gettext-0.21.tar.xz
Already downloaded: /Users/admin/Library/Caches/Homebrew/downloads/fbd8967fd8256b2e1856b74e8ff0f3d8371cb652c5768e47649613a69d4dc841--gettext-0.21.tar.xz
==> Downloading https://ftp.pcre.org/pub/pcre/pcre2-10.35.tar.bz2
Already downloaded: /Users/admin/Library/Caches/Homebrew/downloads/48997c77a7dae2fb85d52234e92e9032019609e091e23d72529d1e552978a260--pcre2-10.35.tar.bz2
==> Downloading https://mirrors.edge.kernel.org/pub/software/scm/git/git-htmldoc

curl: (60) SSL certificate problem: Invalid certificate chain
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.
Error: Failed to download resource "git--html"
Download failed: https://mirrors.edge.kernel.org/pub/software/scm/git/git-htmldocs-2.28.0.tar.xz
Warning: You are using macOS 10.10.
We (and Apple) do not provide support for this old version.
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.

==> Downloading https://ftp.gnu.org/gnu/gettext/gettext-0.21.tar.xz
Already downloaded: /Users/admin/Library/Caches/Homebrew/downloads/fbd8967fd8256b2e1856b74e8ff0f3d8371cb652c5768e47649613a69d4dc841--gettext-0.21.tar.xz
==> Downloading https://ftp.pcre.org/pub/pcre/pcre2-10.35.tar.bz2
Already downloaded: /Users/admin/Library/Caches/Homebrew/downloads/48997c77a7dae2fb85d52234e92e9032019609e091e23d72529d1e552978a260--pcre2-10.35.tar.bz2
==> Downloading https://mirrors.edge.kernel.org/pub/software/scm/git/git-htmldoc

curl: (60) SSL certificate problem: Invalid certificate chain
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.
Error: Failed to download resource "git--html"
Download failed: https://mirrors.edge.kernel.org/pub/software/scm/git/git-htmldocs-2.28.0.tar.xz

我已经尝试了这篇文章的答案,但没有运气。我也不喜欢使用 curl 的 -k 或 --insecure

我在用

更新:我尝试卸载并重新安装自制软件,并在重新安装时再次收到此消息:

curl: (60) SSL certificate problem: Invalid certificate chain
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.
Error: Failed to download resource "git--html"
Download failed: https://mirrors.edge.kernel.org/pub/software/scm/git/git-htmldocs-2.28.0.tar.xz

更新 2: 当我运行 brew doctor 时,我得到了一个不合理的冗长的意外头文件列表。这些和我的问题有关吗?如果是这样,删除所有这些的最佳方法是什么?

更新 3:我最终求助于使用 curl 的 -k。唯一的麻烦是,当我这样做时,终端给了我数百行似乎是随机字符的回报。有谁知道这是什么?不知道在这里做什么

更新 4:不确定这是否相关,但是当我尝试安装 ruby​​ 2.3 时,我收到此错误:

Error running '__rvm_make -j4',
please read /Users/admin/.rvm/log/1596996566_ruby-2.3.8/make.log

是日志

标签: curlopensslssl-certificatehomebrewosx-yosemite

解决方案


对于在此处尝试两种答案都无济于事的阅读者(如我),我找到了解决这个烦人curl (60)问题的方法。运行以下命令:

  • MacBook:~ leetbacoon$ nano ~/.curlrc
  • 添加-k在它自己的行(我没有.curlrc文件,所以整个文件只是-k一个换行符,当然)
  • 运行您的brew install/upgrade它应该从mirrors.edge.kernel.org或任何其他有 SSL 证书问题的站点下载

curl,默认情况下,从~/.curlrc配置文件中读取。-k指示curl忽略 SSL 证书问题,这是我们在这种情况下想要的。我建议-k之后从您的配置文件中删除。

我的设置是使用 El Capitan 10.11.6 / Homebrew 2.5.2 / ruby​​ 2.0.0p648 但没有rvm. 巧合的是,我也在尝试安装git并遇到了这个问题。


推荐阅读