2

I am unable to install Home-brew in my MacBook Pro (Catalina OS). I have tried using the current command in the home-brew website

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

I get past the first stage, but get the following git error afterenter image description here

1
  • This is a bit of a long shot based on a similar StackOverflow post (stackoverflow.com/questions/48987512/…), but try to run networksetup -setv6off Wi-Fi and give it another try. Commented May 4, 2021 at 2:49

4 Answers 4

5

Set your DNS Server to 8.8.8.8

Sign up to request clarification or add additional context in comments.

2 Comments

This worked for me, I recently clean installed macOS Monterey and forgot about this setting. Homebrew installations works now.
How enable DNS in mac? PS: I an new to mac.
4

I rename the .gitconfig file to another and re-install brew, it works for me.
mv ~/.gitconfig ~/.backgitconfig

Rename back after install brew successfully.
mv .backgitconfig .gitconfig

Comments

1

Set your DNS Server to 8.8.8.8 (Google DNS)

Go to Control Panel > Network and Sharing Center > Click on on your wifi connection or ethernet (in case of LAN) > Properties > Double Click Internet Protocol Version 4 (TCP/IPv4) > Set Preferred DNS to 8.8.8.8 and Alternate DNS to 8.8.4.4 > Select Validate Settings on Exit > Click Ok.

This will resolve the issue

Comments

0

Sometimes it happens because of the wrong IP/DNS settings. Checking the below places might help resolve the issue:

  1. Make sure you are using a common public DNS server. How to check the DNS server you are using depends on your operating system. Moreover, if you are using a VPN client and it has a DNS configuration, check that setting too.

  2. Check if there is an IP address associated with GitHub in the system's hosts file. In Linux and macOS you may use sudo vi /etc/hosts. If there is one, turn that line into a comment by adding # at the beginning of the line. Save, exit, and check if you see that error again. Do step 3 only if you are still getting the same error.

  3. Go to https://www.ipaddress.com, search for github.com, and add its IP address at the bottom of /etc/hosts file like this example: 140.82.114.4 github.com.

Hope this helps.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.