How to install and uninstall HomeBrew on your Mac
Before we start
Having spent some years coding applications for macOS we’ve created a tool that everybody can use. The all-round problem fixer for Mac.
So here’s a tip for you: Download CleanMyMac to quickly solve some of the issues mentioned in this article. But to help you do it all by yourself, we’ve gathered our best ideas and solutions below.
Features described in this article refer to the MacPaw site version of CleanMyMac X.
If you’re the kind of Macs user who spends a lot of time using Terminal and need to install other command line tools like cask, htop, or wget, at some point you’ll want to install the Homebrew package manager, which makes it easier to install them. Here’s how to install and how to uninstall Homebrew.
What is Homebrew?
Homebrew is an open-source package management system that simplifies the installation of ‘home-brewed’ software on macOS. That is, the large body of UNIX and open source software available for download. It’s written in Ruby and consists of a git repository, which allows updated repositories to be downloaded from GitHub.
Homebrew downloads the files necessary to install and run a piece of software and then compiles them into binaries for installation.
Why would I install Homebrew?
If you’re interested in installing UNIX tools that don’t come with their own installers for macOS, Homebrew makes finding, creating and configuring installation packages much easier than doing it manually.
How to install Homebrew
In addition to a Mac with Mac OS X or macOS installed and a little knowledge of using bash or zsh, you will need to install Command Line Tools before attempting to install Homebrew. Here’s how to do that.
- Go to Applications>Utilities and double-click Terminal to launch it.
- Type this command: `xcode-select —-install`
- You will see a pop-up window telling you that ‘xcode-select’ requires access to command line developer tools and asking for your permission got install them. Press Install.
- Wait for the installation to finish.
Once Command Line Tools has installed, you can go ahead and install Homebrew like this:
- Launch Terminal again.
- Type in the following command: `/use/bin/ruby -e “$(curl -fsSL
- Press»>https://raw.githubusercontent. Return and you’ll see a number of lines explaining telling you what the script will install and where it will install it.
- Hit Return again.
- Type in your admin password.
- When installation is complete – which could be a while, depending on your Mac and internet connection speed – you will see a message that says ‘installation successful’.
Once you see that message, you can start to install software packages using Homebrew. First, though, it might be worth reading the documentation. To do that, use this command in Terminal:
`brew help`
To install packages, use the following syntax:
`brew install [package name]`
So, to install cask, for example, the command would be:
`brew install cask`
How to uninstall Homebrew on your Mac
There are a number of ways to uninstall Homebrew on your Mac. One method is to use read the documentation and follow the instructions there to manually uninstall. Use this command:
`./uninstall —help`
Another method is to use a ruby curl command to download the uninstall script from GitHub and execute it. To do that, use this command:
`ruby -e “$(curl -fsSL
If»>https://raw.githubusercontent. you don’t want to use curl to execute a script downloaded from the internet, you can download it manually, review it, and then execute it. The script can be downloaded here:
Once»>https://raw.githubusercontent. you’ve downloaded it, save it as a text document and then run the uninstall using that.
The easiest way to uninstall anything on your Mac
If all that seems like a lot of hassle just to uninstall Homebrew, you’re probably looking for an easier way. Did you know there is a much easier way to uninstall any app on your Mac, and that it doesn’t just but the app package in the Trash, but tracks down all of its associated files and gets rid of those too?
CleanMyMac X does just that, and it’s recommended by several well-known Mac websites and blogs as the easiest way to uninstall apps on the Mac. It’s particularly good if you need to uninstall several apps simultaneously. Here’s how to use it.
All the apps you chose will be uninstalled, leaving no trace of them behind. CleanMyMac X can also help when you’re having trouble with apps that are misbehaving. Before you uninstall a troublesome app, try using CleanMyMac X to reset it.
Resetting apps: A feature you’ve missed all along
Resetting an app removes some if its settings and preferences files but leaves the app intact. The next time you launch it, it behaves as if you had just launched it for the first time after downloading it. That may solve performance issues. Here’s how to do it.
- Launch CleanMyMac X.
- Choose the Uninstaller tool.
- Locate the app in the list that’s having problems.
- Click in the drop down menu to the right of the app’s name, where it currently says ‘Uninstall’ and select ‘Reset’.
- You will see that the big Uninstall button at the bottom of the window has changed to Reset. Press it.
- The app will now reset and behave as if it was newly installed.
The app is notarized by Apple and available for a free download here.
If you chose to uninstall Homebrew by downloading the uninstall script manually and saving it as a text file, rather than running the curl script, because your conscious of possible security issues, you’ll want to check out CleanMyMac’s malware tool. It scans you Mac for known malware, and if it finds any offers to remove it.
Homebrew is a very useful tool for anyone who wants to run open-source Unix software on their Mac, but wants a simple way to install it. You’ll have to be comfortable using Terminal in order to install it, but that shouldn’t be an issue if you’re the type of Mac user who’s interested in open source Unix tools.
Как удалить Homebrew?
У меня возникли проблемы с менеджером пакетов, Homebrew . Я не могу найти, как его удалить!
Безопасно ли удалять целые /usr/local ? Homebrew был установлен где-то в этом каталоге.
6 ответов
Homebrew однажды рекомендовал сценарий , также связал в их FAQ . После этого команды изменились , и они предоставить официальный сценарий удаления, который вы можете загрузить и запустить:
ruby -e «$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)»
Вот копия старого сценария для исторических целей:
Это также должно вернуть вашу папку /usr/local в свои дни до Homebrew. Дополнительную информацию см. В домашней установке wiki .
Примечание : вам также может понадобиться удалить
/.homebrew . Если у вас есть
/.rvm , вы должны удалить
Просто запустите в терминале OSX следующее:
Также обратите внимание, что homebrew меняет группу на «штат» и дает доступ к записи для группы для
- /usr/local
- /usr/local/bin
- /usr/local/include
- /usr/local/lib
- /usr/local/sbin
- /usr/local/share
Чтобы вернуть эти каталоги в их исходные состояния, выполните:
для каждого из них или если у вас нет привлекательных владельцев /прав:
Попробуйте этот метод , он удаляет homebrew и связанные кеши, при условии, что вы установили пиво в каталог по умолчанию .
Недавно я создал сценарий для обработки этого случая . Он полностью удаляет Homebrew и имеет опции CLI, такие как режимы молчания /многословности и силы, а также режим, который возвращает местоположение вашей установки Homebrew.
В /usr/local могут быть другие файлы, возможно, вам может понадобиться, чтобы вы могли использовать другой PM (диспетчер пакетов) для удаления текущего PM.
How to Uninstall Homebrew from Mac OS
If you have previously installed Homebrew to a Mac and have now decided that you no longer need or want the command line package manager, you can uninstall Homebrew from MacOS and completely remove Homebrew and all installed packages and formula from the Mac.
This tutorial will walk through how to completely uninstall Homebrew from a Mac, meaning it will remove the entire package manager itself, along with removing the brew and cask commands, along with the various software packages that may have been installed. Notably, this is completely different from simply uninstalling individual packages with Homebrew, which is how you’d remove a particular formula from the package manager.
How to Uninstall & Remove Homebrew in Mac OS
There are a few ways to uninstall Homebrew and remove it from a Mac. Perhaps the simplest method is using a single command string entered into the Terminal, just as you run a ruby and curl command in the command line to install Homebrew, you also run a ruby and curl command to uninstall Homebrew from a Mac.
The single command to uninstall Homebrew is as follows, depending on your version of MacOS:
For uninstalling Homebrew in MacOS Catalina, macOS Big Sur, and MacOS Mojave:
/bin/bash -c «$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)»
For uninstalling Homebrew from MacOS High Sierra, Sierra, El Capitan, and earlier:
ruby -e «$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)»
This uses ruby to execute the Homebrew uninstall script that is downloaded from github with the curl command. When executed properly, the uninstall script will run on the Mac and completely remove Homebrew.
Option 2: Uninstalling Homebrew with the Uninstall Script Manually
If you don’t like the idea of executing a script downloaded from the internet with curl (which is understandable for security conscious individuals), then you can also view, download, and review the uninstall script beforehand, and then execute it manually on the computer that you wish to remove Homebrew from.
The Homebrew uninstall script is located at the following URL:
Save that file as a text document labeled “uninstall” or “uninstallhomebrew” or whatever you want to call it, and then execute the command as usual. Alternatively, you can run the uninstall script with –help flag to get more details and options:
Whether you use either method outlined above, Homebrew will be uninstalled. This will also remove any packages with it, but if you only want to uninstall certain formula and packages rather than Homebrew entirely you should instead focus on these instructions.
The last option, which we’re not going to cover here due to complexity and variability of each users configuration and what packages they have installed, is to manually delete all Homebrew directories, dependencies, formula, and all related files from the wide-ranging Homebrew directory locations, including removing every individual item in the Homebrew installed package location of the Mac. That’s a much more time consuming process, and you’ll be digging around in a variety of system level directories. This method is inappropriate for the vast majority of users – advanced or otherwise – and thus will not be covered. But if you’re curious, use the find, locate, and mdfind commands to discover all Homebrew, brew, cask, and Cellar related data on the Mac.
That’s about it, assuming you ran the Homebrew uninstall scripts the process is pretty straight forward and the removal is complete. Of course if you need and use Homebrew there is no reason to uninstall it, but if you happened to install Homebrew and later discovered it’s of no use to you, it’s perhaps relevant to remove it from your Mac.