I have macOS Mojave version 10.14.5 installed with Xcode version 10.2.1 and Command Line Tools installed using xcode-select --install. All problem started when I tried to install youtube-dl formula on my system by running:

brew install youtube-dl

The output I get is:

Updating Homebrew...
Error: Your Xcode (1) is too outdated.
Please update to Xcode 9.0 (or delete it).
Xcode can be updated from

Error: Your Command Line Tools are too outdated.
Update them from Software Update in the App Store.

Again, if I run xcode-select --install, I get:

xcode-select: error: command line tools are already installed, use "Software Update" to install updates


xcode-select -v


xcode-select version 2354

(I do not know what this means) and running:

xcode-select -p



Owing to these issues, I tried to uninstall Homebrew (with a plan to reinstall it afresh) by running the command:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

but it gives the following error:

curl: (7) Failed to connect to raw.githubusercontent.com port 443: Operation timed out

Next, I tried to uninstall Homebrew using the unbrew.rb script available at GitHub but it seems not to remove Homebrew. I tried running it with and without sudo. Even after doing this, running brew config returns:

ORIGIN: https://github.com/Homebrew/brew
HEAD: 751334a257d81851e68da7ab390982d4e9fdf909
Last commit: 1 year, 10 months ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 3fd7a855a1a357654a4a9a455162761841a4809d
Core tap last commit: 1 year, 10 months ago
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: quad-core 64-bit broadwell
Homebrew Ruby: 2.3.7 => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
Clang: N/A
Git: 2.20.1 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Perl: /opt/local/bin/perl => /opt/local/bin/perl5.24
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
Java: N/A
macOS: 10.14.5-x86_64
Xcode: 1 => /Applications/Xcode.app/Contents/Developer
X11: N/A
MacPorts/Fink: /opt/local/bin/port

Running brew doctor outputs the following:

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: Your Command Line Tools are too outdated.
Update them from Software Update in the App Store.

Error: Unrecognized Mach-O load command: 0x32

Is my Homebrew broken by my attempts at uninstalling it? What can I do to repair Homebrew and all these errors in pointing to the right Xcode and command line tools?

I had tried updating Homebrew by running brew update earlier without success. Running:

brew update


fatal: unable to access 'https://github.com/caskroom/homebrew-cask/': Failed to connect to github.com port 443: Operation timed out
fatal: unable to access 'https://github.com/Homebrew/brew/': Failed to connect to github.com port 443: Operation timed out
fatal: unable to access 'https://github.com/Homebrew/homebrew-core/': Failed to connect to github.com port 443: Operation timed out
Error: Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core failed!
Fetching /usr/local/Homebrew failed!
Fetching /usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask failed!
  • Do you still have Xcode installed? Where is the location Xcode.app bundle? Is Xcode installed from the App Store? Go to Mac App Store, search for Xcode and see if the button besides the app icon reads "Open" or "Get"?
    – Nimesh Neema
    Commented Jul 1, 2019 at 9:14
  • Yes, I always have Xcode installed and updated. To verify, I had gone to the Apple Developer site, opted to install the latest release of Xcode and it redirected to the App Store where the button next to the app indeed read "open'. The Xcode.app is in /Applications.
    – damaihati
    Commented Jul 1, 2019 at 9:49
  • The installed version of Homebrew appears to be too outdated. Your installed version appears to be 1.3.2 while the current public version is 2.1.6. Try running brew update to see if it upgrades Homebrew.
    – Nimesh Neema
    Commented Jul 1, 2019 at 9:51
  • I had tried that a number of times without success before attempting to uninstall Homebrew. Tried again now, have posted the outcome as an edit to the question.
    – damaihati
    Commented Jul 1, 2019 at 10:17
  • The error appears self explanatory. Something is preventing you from connecting to GitHub's servers which hosts Homebrew software's backend. Check if you can access the githubusercontent.com and github.com via a Web browser. Is a proxy or firewall preventing you from connecting?
    – Nimesh Neema
    Commented Jul 1, 2019 at 10:41

1 Answer 1


As is evident from the output of brew config, your installation of Homebrew is pretty outdated. Also, as mentioned in your comment, you have a proxy active in your system. This explains why Homebrew installation is failing to connect unable to the Homebrew software's server counterpart via port 443, which hosted on GitHub.

Follow the instructions in the following answer to update your installation of Homebrew to current version:

If you run into an error similar to:

Error: Permission denied


sudo chown -R `whoami`:admin /usr/local/share

to resolve it.

If you get the following error:

Warning: Homebrew's sbin was not found in your PATH but you have installed formulae that put executables in /usr/local/sbin. Consider setting the PATH for example like so: echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.bash_profile

Run the command-line mentioned in the last line.

Once you have Homebrew updated, run brew cleanup to remove any broken symlinks.

The current public version of Homebrew is 2.1.6. You can check if your installation of Homebrew is up-to-date by running brew config and matching the value with the HOMEBREW_VERSION: key in the output.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .