【问题标题】:How to manually download brew package for installation?如何手动下载brew包进行安装?
【发布时间】:2018-11-30 05:20:58
【问题描述】:

在中国意味着有时您无法通过 brew upgrade 升级 brew 软件包,它会遇到这样的错误:

curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to cli-assets.heroku.com:443 
Error: An exception occurred within a child process:
  DownloadError: Failed to download resource "heroku"
Download failed: https://cli-assets.heroku.com/heroku-v7.18.10/heroku-v7.18.10.tar.xz

我曾经将这些失败的包下载到 ~/Library/Caches/Homebrew,然后再次运行该命令,但在 brew 改变其缓存结构后,这似乎不再起作用(显然对我来说更糟)。

如果我想继续使用 brew 来升级我的所有软件包,我现在该怎么办?

我试过你的方法后,弹出的错误是这样的:

==> Upgrading heroku/brew/heroku 
==> Installing dependencies for heroku/brew/heroku: heroku/brew/heroku-node
==> Installing heroku/brew/heroku dependency: heroku/brew/heroku-node
==> Downloading https://cli-assets.heroku.com/homebrew/node-11.3.0.tar.xz

curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to cli-assets.heroku.com:443 
Error: An exception occurred within a child process:
  DownloadError: Failed to download resource "heroku-node"
Download failed: https://cli-assets.heroku.com/homebrew/node-11.3.0.tar.xz

另外,假设我从https://dl.google.com/go/go1.11.4.src.tar.gz下载go并将其重命名为go--git,这是brew --cache go的输出,但它仍然无法安装。

fatal: unable to access 'https://go.googlesource.com/tools.git/': Failed to connect to go.googlesource.com port 443: Operation timed out
Error: An exception occurred within a child process:
  DownloadError: Failed to download resource "go--gotools"
Failure while executing; `git clone --branch release-branch.go1.11 https://go.googlesource.com/tools.git /Users/aero/Library/Caches/Homebrew/go--gotools--git` exited with 128. Here's the output:
Cloning into '/Users/aero/Library/Caches/Homebrew/go--gotools--git'...
fatal: unable to access 'https://go.googlesource.com/tools.git/': Failed to connect to go.googlesource.com port 443: Operation timed out

如果我运行brew --cache go--gotools,它将显示Error: No available formula with the name "go--gotools"

【问题讨论】:

    标签: homebrew


    【解决方案1】:

    例如,如果您想升级 Gradle,您可以通过以下方式找到 Homebrew 预期的缓存文件的位置和名称:

    brew --cache gradle
    

    您将获得:

    /Users/myself/Library/Caches/Homebrew/downloads/ae76f5a0a19f5c141d5ee602a2ecb45011393fbba2206f3a960599d7bba92b9b--gradle-5.0-all.zip
    

    从以下位置提取 zip 文件的 url:

    brew edit gradle
    

    下载文件并将其重命名为brew --cache的输出

    然后,您甚至可以离线升级 Gradle:

    brew upgrade gradle
    

    根据公式,您必须手动安装它们的所有依赖项。

    【讨论】:

    • 它似乎与 gradle 一起工作,但在涉及 heroku 时失败了。
    • 这不是 Homebrew 的问题,只是您没有网络访问所需文件的权限。您可以尝试在某个地方找到一份副本。
    • 实际上我已经下载了所需的文件。我想他们可能需要去其他地方。如果我使用代理安装 heroku,它不会将文件下载到 Homebrew 的缓存文件夹中。
    • 您必须更改位置并重命名已下载的文件。对于当前版本,heroku 应位于 ~/Library/Caches/Homebrew/downloads/502c1a8a9eda3fb68d67d588c520326776f6212e086f9f26009bda08761aec1e--heroku-v7.19.1.tar.xz
    • heroku 依赖于 heroku 节点。运行 brew --cache heroku-node 显示 /Users/myself/Library/Caches/Homebrew/downloads/d0f9f58aef7c0f3840546c2897aa2fce60c66a2835d2ccfe2a1c6c7ad8503c46--node-11.3.0.tar.xz。您必须下载 node-11.3.0.tar.xz 并将其放置在正确的位置。
    【解决方案2】:

    如果您使用brew upgradebrew install-v 选项或您使用的任何需要下载文件的命令,它将为您提供下载文件所在的输出文件。然后,您可以手动将文件下载到此位置。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-02-12
      • 1970-01-01
      • 2019-01-22
      • 2015-05-13
      • 1970-01-01
      • 2019-12-20
      • 2018-05-28
      • 1970-01-01
      相关资源
      最近更新 更多