Introduction
This guide is specifically designed for beginners who are facing the Homebrew installation error related to network issues, particularly the “error: RPC failed; curl 92 HTTP/2 stream 5 was not closed cleanly: CANCEL (err 8)” message. Follow these steps to resolve this issue.
Step-by-Step Solutions
Check Network Connection
- Ensure your internet connection is stable. If unstable, take steps to stabilize your connection.
- If using a VPN, try disconnecting it to see if access to GitHub improves.
Change Git’s HTTP Transport
- To potentially bypass the issue, switch Git’s HTTP transport to HTTP/1.1:
git config --global http.version HTTP/1.1
Extend Git Timeout Settings
- Increase timeout settings to accommodate slower connections:
git config --global http.postBuffer 524288000 git config --global http.lowSpeedLimit 0 git config --global http.lowSpeedTime 999999
Retry Installing Homebrew
- Run the Homebrew installation script again:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Resetting Changes
If you need to revert the changes made to Git settings, use the following commands to return to default behaviors:
git config --global --unset http.version
git config --global --unset http.postBuffer
git config --global --unset http.lowSpeedLimit
git config --global --unset http.lowSpeedTime