LoginSignup
0
0

【備忘録】Homebrew のインストールで error: RPC failed; curl 92

Last updated at Posted at 2024-05-08

発生した問題

brew をインストールしようとすると、以下のエラーでコケました。

error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8)

詳細

以下の手順に従って、インストールを試行しました。

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

以下のエラーとなりました。

コマンドと出力
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
==> Checking for `sudo` access (which may request your password)...
==> This script will install:
/home/linuxbrew/.linuxbrew/bin/brew
/home/linuxbrew/.linuxbrew/share/doc/homebrew
/home/linuxbrew/.linuxbrew/share/man/man1/brew.1
/home/linuxbrew/.linuxbrew/share/zsh/site-functions/_brew
/home/linuxbrew/.linuxbrew/etc/bash_completion.d/brew
/home/linuxbrew/.linuxbrew/Homebrew

Press RETURN/ENTER to continue or any other key to abort:
==> /usr/bin/sudo /bin/chown -R daiki:daiki /home/linuxbrew/.linuxbrew/Homebrew
==> Found cURL: /home/daiki/anaconda3/bin/curl
==> Downloading and installing Homebrew...
remote: Enumerating objects: 268331, done.
remote: Counting objects: 100% (3295/3295), done.
remote: Compressing objects: 100% (1626/1626), done.
error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8)
error: 19 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
Failed during: /usr/bin/git fetch --force origin

解決

以下のコマンドを入力してから再度インストールコマンドを実行すると、インストールできました。

コマンドと出力
git config --global http.postBuffer 500M
git config --global http.maxRequestBuffer 100M
git config --global core.compression 0

参考情報

これを試しただけです。
https://github.com/orgs/Homebrew/discussions/666#discussioncomment-330934

こう書いてあったから。
https://github.com/orgs/Homebrew/discussions/666#discussioncomment-330985

but following adding the suggested config to the global .gitconfig file, Homebrew was successfully installed. Finally! 😄
=> 翻訳
推奨された構成をグローバルファイル.gitconfigに追加すると、Homebrew は通常にインストールされました。

補足

brewを使えるようにするために

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

:

==> Installation successful!

って出たのに、brew コマンドが使えない。

$ brew --version
コマンド 'brew' が見つかりません。

=> こちらの出力に従って、、、

==> Next steps:
- Run these two commands in your terminal to add Homebrew to your PATH:
    (echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /home/daiki/.bashrc
    eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
- Install Homebrew's dependencies if you have sudo access:
    sudo apt-get install build-essential
  For more information, see:
    https://docs.brew.sh/Homebrew-on-Linux
- We recommend that you install GCC:
    brew install gcc
- Run brew help to get started
- Further documentation:
    https://docs.brew.sh

以下を実行すると使えるようになりました。

(echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /home/daiki/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
$ brew --version
Homebrew 4.2.21

発生した環境

Ubuntu

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.4 LTS
Release:	22.04
Codename:	jammy
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0