Fix Brew stuck/hangs updating in MacOs

Posted by Carles Loriente on August 05, 2023 · 1 min read
Updated on December 13, 2024

The brew (Hombrebrew) package manager is a mush have tool for developers using macOs. It enables you to install, update, and manage a wide range of software packages from the command line. However, sometimes you might encounter issues when updating. If brew update command get stuck you can execute the following commands to fix it.


#!/bin/bash

## Full script for fixing homebrew update error

sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install

## Reset homebrew-cask

brew untap homebrew/homebrew-cask --force
brew reinstall cask

## Reset homebrew-core

brew update-reset -d -v

Download the GitHub Gist fix_brew_stuck_updating.bash

Background header image created using Dream Studio by stability.ai.

Prompt: Create an illustration of fixing Brew updating in MacOs

Download Full size image 2K

Tags:#macos#brew


Found a snippet that saved your day? Consider dropping a tip!