簡體   English   中英

無法使用 brew 安裝任何東西,錯誤:無法下載資源“git--html”

[英]Cannot install anything with brew, Error: Failed to download resource “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

我在用

  • OSX 優勝美地 10.10.5
  • 自制 2.4.9
  • 轉速 1.29.10
  • ruby 2.0.0

更新:我嘗試卸載並重新安裝自制軟件,並在重新安裝時再次收到此消息:

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 時,我得到了一個非常長的意外 header 文件列表 這些和我的問題有關嗎? 如果是這樣,go 關於刪除所有這些的最佳方法是什么?

更新 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

是日志

對於在此處嘗試了這兩個答案但無濟於事的任何閱讀者(如我),我找到了解決煩人的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並遇到了這個問題。

看起來下載器(在這種情況下為 curl 版本)不信任https://mirrors.edge.kernel.org域上的 CA 證書您可以嘗試導入此網絡服務器提供的 CA(取決於您是否真的信任 CA)。

要導入證書,您可以下載證書,然后雙擊證書。 MacOS 默認會通過 Keychain 打開它並詢問您是否要導入它。 你可以參考官方文檔

wget http://crt.sectigo.com/SectigoRSADomainValidationSecureServerCA.crt

筆記

如果您在任何其他域中遇到此問題,您如何知道從哪里下載證書。

您可以檢查服務器頒發的證書以獲取上述鏈接。 例如:

$ echo | openssl s_client -connect mirrors.edge.kernel.org:443 2>/dev/null \
  | openssl x509 -noout -text | grep "CA Issuers"

 CA Issuers - URI:http://crt.sectigo.com/SectigoRSADomainValidationSecureServerCA.crt

PS:我無法讓我的-ext標志在 libressl 上工作,因此 hacky grep

注意 URL。 這是您需要信任的證書的位置,以便信任 brew 安裝。 這個 URL 很可能出現在證書的授權信息訪問部分。

我在下載 git--html 時也遇到了一些問題(10.11)。 如果你打開 finder 並點擊 command + shift + G 並輸入 /usr/local/cellar 你會希望找到你的包的文件夾。 之后找到 bin 文件夾並在 bin 文件夾中啟動可執行文件(它將具有終端圖標)。 它應該是什么樣子(1.3.5 文件夾內的 bin 文件夾)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM