Tips on how to Set up Mac Apps in Terminal Utilizing Homebrew

Once you've configured a new Mac from scratch, installing a dozen or more apps is a daunting task. You need to visit all of the application websites and set the apps according to your needs. It takes time and patience.

You can solve this problem with a third-party package manager called Homebrew. It simplifies the installation of Unix tools and popular GUI apps available for Mac. We'll show you how to install apps from the terminal via homebrew and easily keep them up to date.

What is homebrew?

Homebrew is a free, open source package manager that allows you to install any type of app on a Mac, such as: B. Third-party command line tools and GUI apps. Find, install, uninstall, or update Unix tools with a single command.

The system requirements for homebrew are:

  • Terminal app

  • macOS Catalina 10.15 or higher (versions 10.10 to 10.14 are supported but not on the priority list)

  • Command line tools for Xcode or Xcode from the Mac App Store

  • Bourne-Again Shell (bash) for installation

How to install homebrew on a Mac

To install Homebrew you will need command line tools (which take up about 200MB). If you already have Xcode installed on your Mac, the package is already built into it. However, you don't have to install Xcode (which takes around 10GB or more of space) just to install Homebrew.

MAKEUSEOF VIDEO OF THE DAY

Step 1: Install Command Line Tools

Open minded terminal and run the following command:

xcode-select –install

As you type this command, a popup will appear saying, “xcode-select command requires command line developer tools. Would you like to install these tools now? ”Press the To install Button to continue with the installation. Since I have already installed this package, it shows an error message, as can be seen in the screenshot.

Step 2: install homebrew

Run the following command from the homebrew website in Terminal:

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

This script installs homebrew in its preferred location: / usr / local for Intel Macs, / opt / homebrew for M1 Macs and /home/linuxbrew/.linuxbrew for Linux.

Note: The one-line installation script requires the "bash" shell. In particular, zsh, fish, tcsh, and csh don't work. Since macOS Catalina and higher, the default shell has been “ZSH”, you may have to switch to “bash” to install Homebrew.

When you include this command you will see a series of lines about what the script installs and where it is located. Enter the administrator password and press To return one more time to continue. The installation process will take some time. You also see a Installation successful Message.

Step 3: check the homebrew installation

To verify the installation, do the following:

brew doctor

When you see one warning You don't have to worry about Message as it only helps maintainers debug if you report a problem. However, check out some common installation problems on the homebrew website. We also recommend you to run brew doctor regularly.

By definition, a package manager consists of command line tools and a suite of services that automate the software management process such as app installation, upgrade, uninstallation, and more. The package consists of software binaries, configuration files, and metadata. The metadata, in turn, handle all dependencies.

For example, an app might need two or more packages to function properly. It installs all the packages and configures the development environment without having to manually install the tools. Here are some popular Unix tools:

  • youtube-dl Allows you to download videos from Youtube and other websites.
  • geoip gives you the geolocation data for a specific IP address. Useful for system administrators, security researchers, and web developers.
  • wget allows data to be downloaded from the Internet and from an FTP. You can save a file that Chrome won't download, or even an entire website.
  • htop is a command line alternative to Activity Monitor for Mac. It gives you comprehensive information on CPU, memory, processes, and more.
  • pyenv is a tool for managing multiple Python versions. You can even switch between multiple versions of Python.

Install and manage apps from the terminal through homebrew

brew is the core command that is central to the entire homebrew package manager. formula is a package definition created from the source repository. barrel is an extension for brew that allows you to install native apps for Mac via the terminal.

Many new features and changes have been implemented since the release of previous versions of Homebrew (especially version 1.8.0). The minimum operating system compatibility has been increased to macOS Catalina, Brew barrel Commands were deprecated when needed (with -cask), integration with Github releases was added, and Apple silicon Macs were supported.

First, type the following command to see the list of key commands you'll likely use to manage apps through homebrew:

brew help

Here is a list of useful homebrew formula and cask commands.

1. Install

brew install formula | barrel

For example, brew install pyenv and brew install fantastic.

2. Uninstall

brew uninstallation formula | barrel

brew uninstall –force (formula name)

Uninstall brew –zap (barrel name)

When you hang on -Power, it deletes all installed versions of a formula while ignoring file removal errors. -zap removes all files associated with a cask.

Note: It can remove files shared between apps.

3. List

brew list formula | barrel

brew list –formula

brew list –cask

List all installed formulas and barrels. Attach -Formula just list formulas and -Barrel List barrels.

4. Update and update

Upgrade Formula Brew | Barrel

Update outdated, unpinned formulas and barrels. If you specify a barrel or formula, only the specified tool will be updated. In contrast, brew update reports outdated formulas and suggests Brewing upgrade.

Search text brew | / regex /

Do a search in cask tokens and formula names for text. You can put a slash next to the text to do a regex search. Attach -Formula to search for formulas online and locally and -Barrel to search for barrels online or locally.

6. Obsolete

outdated formula brew | barrel

brew outdated formula

brew out of date –cask

List outdated barrels and formulas. Attach -Formula to list the obsolete formula, or -Barrel for an app.

7. Attach and detach

Brew pen installed_formula

brew unpin Installed_Formula

Freeze a specific formula before upgrading when you output the Brewing upgrade Command. Release the peg to update the package.

8. Dependencies

Brew Deps Formula | Barrel

Shows dependencies for a specific formula.

9. Clean up

Brew cleaning formula | barrel

Removes obsolete lock files and obsolete packages for all formulas and kegs. It removes all downloads that are older than 120 days.

Cakebrew: The Mac app for homebrew

Cakebrew is a free, open source app that works with homebrew. The app allows you to view the list of installed formulas, do a quick search, and see the description of the formulas you want to install. You can view the list of dependencies required or installed for a particular formula.

It even supports Homebrew / bundle to export and import your formulas. If you like homebrew but don't want to use the command line for every purpose, this app will come in handy. Enter the following to install Cakebrew:

brew install cakebrew

Within a few minutes you will see the app in / Applications Folder.

Homebrew and barrel workflow for Alfred

The Homebew and Cask workflow for Alfred allows you to install, uninstall, and manage Homebrew and Casks at the same time. The script filters Brew and Cask with support for all important commands such as Doctor, Install, List, Search, Deinstall and more.

begin Alfred, then type in brew or barrel to manage apps directly from Alfred. You need Alfred Powerpack to use this workflow.

Install open source apps with homebrew

Homebrew is a great package manager for installing apps on Mac through Terminal. Setting up a Mac from scratch or working in a company that manages multiple Macs can save a lot of time and energy.

It is easy for beginners to get lost on all of these commands, but there is no need to rush. Take these steps slowly and write down the commands. After installing Homebrew, try installing some lesser-known open source Mac apps as homework.

15 free, open source Mac apps you need to install

Do you want to use open source software on your Mac? These macOS apps are open source, great, and best of all … free!

Continue reading

About the author

Rahul Saigal
(170 articles published)

With an M.Optom degree in ophthalmology, Rahul taught for many years at the college. Writing and teaching others is always his passion. He's now writing about technology and making it digestible for readers who don't understand it well.

More
From Rahul Saigal

Subscribe to our newsletter

Subscribe to our newsletter for tech tips, reviews, free e-books, and exclusive deals!

Click here to subscribe

Leave a Reply

Your email address will not be published. Required fields are marked *