Edited 1 month ago by ExtremeHow Editorial Team
HomebrewmacOSUninstallationSoftware RemovalCleanupTerminalCommand LineSystem MaintenanceTroubleshootingProductivity
This content is available in 7 different language
Homebrew is a popular package manager for macOS that makes it easy to install useful software on your Mac. However, there may be times when you want to uninstall Homebrew from your system. This could be because you no longer need it or perhaps because you are experiencing problems and want to start afresh. Completely uninstalling Homebrew requires a few steps to ensure that all of its components are removed from your system. This guide will walk you through the process of uninstalling Homebrew using easy-to-understand instructions.
Homebrew is known as the “missing package manager for macOS”. It helps you install various command-line utilities, desktop applications, and programming languages by compiling source packages. Sometimes, users want to uninstall Homebrew to reset their configuration, free up disk space, or find an alternative package manager. There are several terminal commands that can be executed to uninstall it manually, which will be explained in detail in this tutorial.
Before you begin the uninstallation process, it's a good idea to check if Homebrew is actually installed on your system. You can do this by opening the Terminal application on your Mac and typing:
brew --version
If Homebrew is installed, this command will display the version information about Homebrew. Knowing that Homebrew is installed confirms that you can proceed with the uninstallation process.
The most straightforward way to uninstall Homebrew is to use the uninstall script provided by Homebrew. You can do it like this:
Open a Terminal window, then copy and paste the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
Press Enter to run this command. This will execute a script that will completely uninstall Homebrew from your system. You will be asked to confirm the deletion, and in some cases, you may be asked for your password to authorize the operation.
If you encounter any problems with the above script, Homebrew provides an alternative version on GitHub, which you can download and run locally.
While automated scripts are typically the easiest method, you can opt to uninstall Homebrew manually. The manual process involves deleting Homebrew's installation directory and associated files.
Homebrew is usually installed in the /usr/local
directory. To remove Homebrew's installation files from this directory, use the following command:
rm -rf /usr/local/Homebrew
This command forcefully removes the Homebrew
directory and all its contents. Make sure you type this command correctly because using rm -rf
will permanently delete the files from your system.
Homebrew also maintains a cache that stores downloaded versions of formulas. You can delete this cache to free up space using the following command:
rm -rf /Library/Caches/Homebrew
This command will remove all cache files associated with Homebrew.
Homebrew writes configuration files, logs, and other data to /usr/local/etc
or other directories. A common command to delete such files is:
rm -rf /usr/local/etc /usr/local/var/homebrew /usr/local/Cellar
Keep in mind that these directories may contain other files or configurations that you might want to keep, so review the contents before deleting.
If you've made changes to your environment variables to make Homebrew easier to use, such as modifying your .bash_profile
or .zshrc
files, you should remove all lines that include Homebrew paths.
Once you've followed the steps above, it's a good idea to verify that Homebrew is completely uninstalled. Try running any of the following commands in your terminal:
brew update
If Homebrew has been removed, the command will not be recognized, and you will see a "command not found" error. This ensures that Homebrew is no longer installed on your system.
Uninstalling Homebrew from macOS is a process that can be completed using a given script or through manual steps. Both methods ensure that all components of Homebrew are removed from your system, leaving it clean and with no remnants of the package manager. Whether you choose to automate the uninstallation or manually tackle the file system, it is important to follow the steps carefully to avoid unintentional deletion of important files. After removing Homebrew, your system is free of the package manager until you decide to reinstall it.
If you find anything wrong with the article content, you can