Pirobits
  

Brew, manage packages on MacOS

alberto avatar Alberto Sola · 3/6/2024 · 2 min

For a couple of years now, I've been working almost exclusively with MacOS (or managing servers with Linux). I have a Windows computer (I recently sold a tower since I only used it for gaming, but I really don't have time to play or like it).

I'm not an Apple fanboy, I just like their ecosystem because they do things well, but I've always worked with Ubuntu or Windows with WSL and it wouldn't be a problem for me to switch.

When you come from Ubuntu, which brings the apt-get command with which you manage programs, or Windows where everything goes through installers, then you get to MacOS and it's a kind of hybrid.

The most common thing is to use Homebrew, known as brew, to install and manage packages on MacOS from the command line. In general, it makes it easier for you to install tools and services for development.

Installing brew

To install Homebrew on your MacOS system, you must first open the Terminal. Once open, copy and paste the following command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

This command downloads and executes the Homebrew installation script.

Adding a package

brew install <package>

Uninstalling a package

brew uninstall <package>

Cleaning up obsolete packages

Many times I install some tools to try them out, or because I need them and when I later remove them, I realize that "remains" of packages that have not been removed are left behind. To do this, from time to time run the following commands:

brew autoremove
brew cleanup

You can see the full documentation on the https://brew.sh page.

Did you find this article useful? Subscribe to my newsletter and take the first step to launch IT products faster. You will receive exclusive tips that will bring you closer to your goals.


Recent posts