HomeBrew
January 26, 2022 | StackThe Open Source package manager for macOS
Though this package manager is also available for Linux, the chances are that you've mostly heard of it in relation to Apple's macOS. Why install such a tool on your macOS, does'nt it increase voulnerbillity of a generally secure operating system with all of Apple's validation and approval of software at the official Appstore? Yes.
But, if you want to get your hands on all the cool stuff out there for developers, HomeBrew is the way to go. If you want to max out the performance of your Mac and your self and get almost unlimited freedom of what is possible on this UNIX system, HomeBrew is a good starting point.
Install HomeBrew
Open your favorite terminal and run this command to install Xcode's command line tool:
xcode-select --install
At HomeBrew's git repository there is a install script, run that:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
This may take a few minutes. After completion make sure everything went good and see if there are any updates:
brew update
If you by any reason want to uninstall HomeBrew, they have also made an uninstall script:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
Installation of packages
To install a new package with (Home)Brew use the following command:
brew install [package name]
Update packages
As you probably saw in the above section, the brew update command will update the package manager it self, but also all packages. As with Aptitude package manager, you will also have to use theĀ upgrade command install the available updates. The following command will update and upgrade everything, including HomeBrew:
brew update && brew upgrade
If you want to update a specific package use the following command:
brew outdated
The above command will give you a list of outdated packages, the following command can be used to update those packages:
brew update [package name]
Removing packages
The simple way of removing a package is just using the uninstall command:
brew uninstall [package name]
But often, depending on what you are uninstalling there may be dependencies that you might not want to remove. To see what dependencies there are to a specific package, use the following command:
brew deps [package name]
To remove the package and not it's dependencies use the following command:
brew uninstall --ignore-dependencies [package name]
Analytics for the developers
HomeBrew gather analytics, from the machine where it is installed, it gives a good insight for the developers to improve the software. But, for many reasons you might not want information sent to the developer team and it is possible to turn of:
brew analytics off
after that check if it is turned off:
brew analytics