HomeBrew on Mac

Amir Hoss
2 min readMar 6, 2024

--

Homebrew is a free and open-source software package manager designed for macOS (Apple’s operating system) and Linux that simplifies the installation and management of software.

Here are some reasons why developers use Homebrew:

Easy Installation
Homebrew provides a straightforward way to install various tools, libraries, and applications. Instead of manually downloading and configuring software, you can use Homebrew to handle dependencies and updates.

Command-Line Interface (CLI)
Homebrew operates from the terminal, allowing you to manage software using simple commands. This is especially useful for developers, system administrators, and power users who prefer working with the command line.
Using simple commands like brew install <package_name>

Version Control
Homebrew keeps track of different versions of software packages. You can easily switch between versions or update to the latest release without much hassle.

Community-Driven
Homebrew is an open-source project maintained by a community of contributors. It ensures that packages are up-to-date and compatible with the latest macOS versions.

Customization
Homebrew allows you to customize your development environment by installing specific tools and libraries. You can tailor your setup to your needs.

Dependency Management
When you install a package using Homebrew, it automatically resolves and installs any required dependencies. This simplifies the process and prevents conflicts.

Uninstallation and Cleanup * it is very important for me
Homebrew makes it easy to uninstall software or clean up old versions. You can remove packages cleanly without leaving behind unnecessary files.

Extensibility
Homebrew supports “formulae,” which are scripts that define how to build and install software. If a package you need isn’t available, you can create your own formula or contribute to the community.

Install HomeBrew

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

Important Commands

//Version
$ brew -v

//Update
$ brew update

// Upgrade All or one package
$ brew upgrade node

// Removing outdated versions of installed packages and any unused dependencies
$ brew cleanup

// Remove any unused dependencies
$ brew autoremove

// Check system for potential issues:
$ brew doctor

Packages on brew

// List of all installed packages
$ brew list

// Search for available formulae
$ brew search <text>

// Get information about brew
$ brew info

// Install new package for instance "node"
$ brew install node
$ npm -v
$ node -v
$ brew upgrade node

// Get detail information about a package
$ brew info <package_name>
// Uninstall package
$ brew uninstall node

--

--

Amir Hoss

✔Senior PHP Developer✔Mobile Developer✔MySQL Administrator [myWebsite:https://amirhome.com]