Add packages with Brew

🗓 Previously on Mac2net – I introduced Brew – the Mac package manager

Add packages with Brew

In Basic Tools – Brew](3 Basic Tools – Brew.md) I installed Brew on a remote MacBook Air I7 (16GB RAM 500GB SSD). Before we get going on installing actually useful packages, I suggest adding two more utilities.

Install a text/code editor

You are going to need a decent code editor, with syntax highlighting, some form of decent file management, a few accessible menu selections and key commands and finally decent search including an easy way to perform grep like searches – multi-file is preferable. There are many free and paid tex/code editor apps out there. When I searched for reviews I discovered most of the editors mentioned were rather uneventful. If you don’t already have an editor of choice, or you are unsure of what it is, I suggest downloading a working demo of BBEdit.

Install an SFTP GUI app

Personally I don’t like using the command line to copy files as I am not that experienced at doing this and it is easy to make a mistake. Cyberduck is a free multi-platform SFTP app. Open Cyberduck and create a new bookmark.


cyberduck_bookmark

Create a shell script to batch install packages

I hacked some Brew commands combined with some GREP file manipulations in BBEdit to create a shell script to install a list of interesting packages on his machine. I wrote this script…


#!/bin/sh

# Packages

echo "Packages…"

brew install atuin # : Improved shell history for zsh, bash, fish and nushell
brew install automake # : Tool for generating GNU Standards-compliant Makefiles
brew install bat # : Clone of cat(1) with syntax highlighting and Git integration
brew install bottom # : Yet another cross-platform graphical process/system monitor
brew install bpytop # : Linux/OSX/FreeBSD resource monitor
brew install btop # : Resource monitor. C++ version and continuation of bashtop and bpytop
brew install byobu # : Text-based window manager and terminal multiplexer
brew install dua-cli # : View disk space usage and delete unwanted data, fast
brew install duf # : Disk Usage/Free Utility - a better 'df' alternative
brew install dust # : More intuitive version of du in rust
brew install eza # : Modern, maintained replacement for ls
brew install fastfetch # : Like neofetch, but much faster because written mostly in C
brew install ffmpeg # : Play, record, convert, and stream audio and video
brew install gdbm # : GNU database manager
brew install gdu # : Disk usage analyzer with console interface written in Go
brew install ghostscript # : Interpreter for PostScript and PDF
brew install gitui # : Blazing fast terminal-ui for git written in rust
brew install glances # : Alternative to top/htop
brew install glow # : Render markdown on the CLI
brew install gnupg # : GNU Pretty Good Privacy (PGP) package
brew install go # : Open source programming language to build simple/reliable/efficient software
brew install gpg-tui # : Manage your GnuPG keys with ease!
brew install gpgme # : Library access to GnuPG
brew install grsync # : GUI for rsync
brew install highlight # : Convert source code to formatted text with syntax highlighting
brew install iftop # : Display an interface's bandwidth usage
brew install imagemagick # : Tools and libraries to manipulate images in many formats
brew install intltool # : String tool
brew install iperf3 # : Update of iperf measures TCP, UDP, and SCTP bandwidth
brew install jq # : Lightweight and flexible command-line JSON processor
brew install libffi # : Portable Foreign Function Interface library
brew install libyaml # : YAML Parser
brew install lima # : Linux virtual machines
brew install macvim # : GUI for vim, made for macOS
brew install make # : Utility for directing compilation
brew install marp-cli # : Easily convert Marp Markdown files into static HTML/CSS, PDF, PPT and images
brew install mas # : Mac App Store command-line interface
brew install midnight-commander # : Terminal-based visual file manager
brew install navi # : Interactive cheatsheet tool for the command-line
brew install ncdu # : NCurses Disk Usage
brew install neovim # : Ambitious Vim-fork focused on extensibility and agility
brew install nload # : Realtime console network usage monitor
brew install nmap # : Port scanning utility for large networks
brew install node # : Platform built on V8 to build network applications
brew install ntopng # : Next generation version of the original ntop
brew install nushell # : Modern shell for the GitHub era
brew install openssl@3.5 # : Cryptography and SSL/TLS Toolkit
brew install p7zip # : 7-Zip (high compression file archiver) implementation
brew install pandoc # : Swiss-army knife of markup format conversion
brew install pkgconf # : Package compiler and linker metadata toolkit
brew install poppler # : PDF rendering library (based on the xpdf-3.0 code base)
brew install procs # : Modern replacement for ps written in Rust
brew install rclone # : Rsync for cloud storage
brew install readline # : Library for command-line editing
brew install restic # : Fast, efficient and secure backup program
brew install rsync # : Utility that provides fast incremental file transfer
brew install ruby-install # : Install Ruby, JRuby, Rubinius, TruffleRuby, or mruby
brew install slides # : Terminal based presentation tool
brew install sntop # : Curses-based utility that polls hosts to determine connectivity
brew install socket_vmnet # : Daemon to provide vmnet.framework support for rootless QEMU
brew install speedtest-cli # : Command-line interface for https # ://speedtest.net bandwidth tests
brew install sphinx-doc  # : Tool to create intelligent and beautiful documentation
brew install superfile # : Modern and pretty fancy file manager for the terminal
brew install termscp # : A feature rich terminal file transfer and explorer with support for SCP/SFTP/FTP/S3
brew install tmux # : Terminal multiplexer
brew install tre-command # : Tree command, improved
brew install vips # : Image processing library
brew install vte3 # : Terminal emulator widget used by GNOME terminal
brew install webp # : Image format providing lossless and lossy compression for web images
brew install wget # : Internet file retriever
brew install wireguard-tools # : Tools for the WireGuard secure network tunnel
brew install wtfutil # : Personal information dashboard for your terminal
brew install xz # : General-purpose data compression with high compression ratio
brew install zellij # : Pluggable terminal workspace, with terminal multiplexer as the base feature
brew install zoxide # : Shell extension to navigate your filesystem faster
brew install dyff # : δyƒƒ /ˈdʏf/ - A diff tool for YAML files, and sometimes JSON
brew install virt-viewer # : App for virtualized guest interaction
brew install lazygit # : A simple terminal UI for git commands, written in Go
brew install termscp # : A feature rich terminal file transfer and explorer with support for SCP/SFTP/FTP/S3/Kube/SMB WebDAV

echo "Casks…"
brew install --cask applite # : (Applite) User-friendly GUI app for Homebrew
brew install --cask calibre # : (calibre) E-books management software
brew install --cask font-hack-nerd-font # : (Hack Nerd Font (Hack)) [no description]
brew install --cask fsnotes # : (FSNotes) Notes manager
brew install --cask geany # : (Geany) Small and lightweight IDE
brew install --cask libreoffice # : (LibreOffice) Free cross-platform office suite, fresh version
brew install --cask losslesscut # : (LosslessCut) Trims video and audio files losslessly
brew install --cask macdown # : (MacDown) Open-source Markdown editor
brew install --cask macfuse # : (macFUSE) File system integration
brew install --cask rio # : Hardware-accelerated GPU terminal emulator powered by WebGPU
brew install --cask vorta # : (Vorta) Desktop Backup Client for Borg
brew install --cask wezterm # : (WezTerm) GPU-accelerated cross-platform terminal emulator and multiplexer
brew install --cask zed # : (Zed) Multiplayer code editor
brew install --cask zettlr # : (Zettlr) Open-source markdown editor


In order to execute the script, I did the following:


I copied the file into the home directory of the remote Mac. This makes it easier to manipulate the script when I log into the machine via SSH in the terminal ~/[name-of-script].sh. With Cyberduck, this is as easy as copying the file in the Finder and pasting it into the home directory on the remote Mac in the app. One can also navigate to the file in the left pane of Cyberduck and then drag the file over to the remote Mac.


Please note: In the list of packages above there is a TUI-based SFTP app – termscp which seems to work fine.


The next step is to logon to the remote Mac. This should automatically send you to its home directory. Before executing the script, it is necessary to make the file executable.


chmod u+x [name-of-script].sh 


Now execute the script…


./[name-of-script].sh 


The script above took about 30 minutes to complete from my pseudo fiber cable connection. I have broken out some things to watch for. If there is an error in the syntax or spelling of one of the packages Brew will pass over it. Here is the beginning of the script’s execution.


09-Oct 15:55 [user-machine]~$ ./brew-install.sh                    
Packages…
==> Fetching downloads for: atuin
==> Downloading https://ghcr.io/v2/homebrew/core/atuin/manifests/18.8.0
###########################################100.0%
==> Fetching atuin
==> Downloading https://ghcr.io/v2/homebrew/core/atuin/blobs/sha256:9dd094529e7b783f52059574da65b59d0fb7446d942c337
###########################################100.0%
==> Pouring atuin--18.8.0.sonoma.bottle.tar.gz
==> Caveats
To start atuin now and restart at login:
  brew services start atuin
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/atuin/bin/atuin daemon
==> Summary
🍺  /usr/local/Cellar/atuin/18.8.0: 14 files, 31.6MB
==> Running `brew cleanup atuin`...
Disable this behaviour by setting `HOMEBREW_NO_INSTALL_CLEANUP=1`.
Hide these hints with `HOMEBREW_NO_ENV_HINTS=1` (see `man brew`).
Removing: /Users/[home]/Library/Caches/Homebrew/atuin--18.4.0.tar.gz... (626.5KB)
==> Caveats
zsh completions have been installed to:
  /usr/local/share/zsh/site-functions


This clip shows how Brew installs a package with dependencies…


==> Fetching downloads for: bat
==> Downloading https://ghcr.io/v2/homebrew/core/bat/manifests/0.25.0_1
###########################################100.0%
==> Fetching dependencies for bat: ca-certificates, openssl@3, libssh2, libgit2 and oniguruma
==> Downloading https://ghcr.io/v2/homebrew/core/ca-certificates/manifests/2025-09-09-1
###########################################100.0%
==> Fetching ca-certificates
==> Downloading https://ghcr.io/v2/homebrew/core/ca-certificates/blobs/sha256:bf8219c33f6de8c2554cff8bcff1e9061ba61
###########################################100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/manifests/3.6.0
###########################################100.0%
==> Fetching openssl@3
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/blobs/sha256:a015d2e06290484b37547a57b60c6bc5bd45be0479e
###########################################100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libssh2/manifests/1.11.1
###########################################100.0%
==> Fetching libssh2
==> Downloading https://ghcr.io/v2/homebrew/core/libssh2/blobs/sha256:092a33680301532d2ba966e85b3316198d65891a0aa62
###########################################100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libgit2/manifests/1.9.1
###########################################100.0%
==> Fetching libgit2
==> Downloading https://ghcr.io/v2/homebrew/core/libgit2/blobs/sha256:e78dcb0d653757bf490171d0f06ef2d2a9cd84adcf062
###########################################100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/oniguruma/manifests/6.9.10
###########################################100.0%
==> Fetching oniguruma
==> Downloading https://ghcr.io/v2/homebrew/core/oniguruma/blobs/sha256:174fa500f45c9421915e22c34f51abc2849cbce2c05
###########################################100.0%
==> Fetching bat
==> Downloading https://ghcr.io/v2/homebrew/core/bat/blobs/sha256:c9dc4cc4d679e32223eec006c4b52c46fcee17e67fdb762dd
###########################################100.0%
==> Installing dependencies for bat: ca-certificates, openssl@3, libssh2, libgit2 and oniguruma
==> Installing bat dependency: ca-certificates
==> Downloading https://ghcr.io/v2/homebrew/core/ca-certificates/manifests/2025-09-09-1
Already downloaded: /Users/[user-machine]/Library/Caches/Homebrew/downloads/4d4fbd31e178e7d46676ee46b8a629a56cf084bda67d2ae2d543a7a9b8d0718a--ca-certificates-2025-09-09-1.bottle_manifest.json
==> Pouring ca-certificates--2025-09-09.all.bottle.1.tar.gz
==> Regenerating CA certificate bundle from keychain, this may take a while...
🍺  /usr/local/Cellar/ca-certificates/2025-09-09: 4 files, 232.8KB
==> Installing bat dependency: openssl@3
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/manifests/3.6.0
Already downloaded: /Users/[user-machine]/Library/Caches/Homebrew/downloads/403c903e557d19d801f4c6b4f635c9553af72a487024139a5773e636c884ef9e--openssl@3-3.6.0.bottle_manifest.json
==> Pouring openssl@3--3.6.0.sequoia.bottle.tar.gz
🍺  /usr/local/Cellar/openssl@3/3.6.0: 7,609 files, 36.3MB
==> Installing bat dependency: libssh2
==> Downloading https://ghcr.io/v2/homebrew/core/libssh2/manifests/1.11.1
Already downloaded: /Users/[user]/Library/Caches/Homebrew/downloads/6d2495eb2b5f37f7931b23940ceb29db14a4742a49d1d8cce26964ad91a03f26--libssh2-1.11.1.bottle_manifest.json
==> Pouring libssh2--1.11.1.sonoma.bottle.tar.gz
🍺  /usr/local/Cellar/libssh2/1.11.1: 201 files, 1.2MB
==> Installing bat dependency: libgit2
==> Downloading https://ghcr.io/v2/homebrew/core/libgit2/manifests/1.9.1
Already downloaded: /Users/[user]/Library/Caches/Homebrew/downloads/6e665b2e520a25929d0347f220fed4c93744ac835372978af6abeedcbe0017eb--libgit2-1.9.1.bottle_manifest.json
==> Pouring libgit2--1.9.1.sonoma.bottle.tar.gz
🍺  /usr/local/Cellar/libgit2/1.9.1: 109 files, 4.9MB
==> Installing bat dependency: oniguruma
==> Downloading https://ghcr.io/v2/homebrew/core/oniguruma/manifests/6.9.10
Already downloaded: /Users/[user]/Library/Caches/Homebrew/downloads/04e9c35970e8b4c6db751bdaa577e7185a85d364ccc66e079983f524aab95a85--oniguruma-6.9.10.bottle_manifest.json
==> Pouring oniguruma--6.9.10.sonoma.bottle.tar.gz
🍺  /usr/local/Cellar/oniguruma/6.9.10: 15 files, 1.4MB
==> Installing bat
==> Pouring bat--0.25.0_1.sonoma.bottle.tar.gz
🍺  /usr/local/Cellar/bat/0.25.0_1: 15 files, 4.6MB
==> Running `brew cleanup bat`...
Disable this behaviour by setting `HOMEBREW_NO_INSTALL_CLEANUP=1`.
Hide these hints with `HOMEBREW_NO_ENV_HINTS=1` (see `man brew`).
==> Caveats
zsh completions have been installed to:
  /usr/local/share/zsh/site-functions

Casks

homebrew-cask


Here is an example of Brew installing casks.


There are three different examples of a cask install below. The first one – Zettir – is the simplest. The second one – macFuse – requires an admin user password and actually halts the script. The third cask – Vorta – explains that, depending on how the package is used, may require other packages and details what to do depending on the circumstances.


==> Installing Cask zettlr
==> Moving App 'Zettlr.app' to '/Applications/Zettlr.app'
🍺  zettlr was successfully installed!

==> Installing Cask macfuse
==> Running installer for macfuse with `sudo` (which may request your password)...
Password:
installer: Package name is macFUSE
installer: Installing at base path /
installer: The install was successful.
==> Changing ownership of paths required by macfuse with `sudo` (which may request your password)...
🍺  macfuse was successfully installed!
==> Downloading https://github.com/raphamorim/rio/releases/download/v0.2.31/rio.dmg
==> Downloading from https://release-assets.githubusercontent.com/github-production-release-asset/546129875/e8a541ab-46ca-4

==> Caveats
vorta requires BorgBackup to run. If you do not need mount support, use
the official formula:

  brew install borgbackup

If you plan on mounting archives using macFUSE, consider using the Tap
maintained by the Borg team:

  brew install --cask macfuse
  brew install borgbackup/tap/borgbackup-fuse

==> Downloading https://github.com/borgbase/vorta/releases/download/v0.10.3/Vorta-v0.10.3-intel.dmg
==> Downloading from https://release-assets.githubusercontent.com/github-production-release-asset/154956532/cf826e4c-7cc1-4
###########################################100.0%
==> Installing Cask vorta
==> Moving App 'Vorta.app' to '/Applications/Vorta.app'
🍺  vorta was successfully installed!


Finally when the script is complete, we can run ncdu a newly installed TUI package to see how much space all those packages use on the remote Mac.


ncdu 2.9.1 ~ Use the arrow keys to navigate, press ? for help                                                              
[user-machine]$ ncdu /usr/local

--- /usr/local
    3.5 GiB [#################] /Cellar                                                                                    
  214.4 MiB [#                ] /Homebrew
   18.2 MiB [                 ] /lib
   14.8 MiB [                 ] /Caskroom

# Use the down-arrow to navigate to “Caskroom” and hit return to enter that directory
  436.3 MiB [#                ] /Zettlr.app
  116.5 MiB [                 ] /Vorta.app
   22.1 MiB [                 ] /MacDown.app
  350.3 MiB [                 ] /LosslessCut.app
  823.6 MiB [##               ] /LibreOffice.app
  113.3 MiB [                 ] /Geany.app
   51.2 MiB [                 ] /FSNotes.app
    1.0 GiB [##               ] /calibre.app
    9.1 MiB [                 ] /Applite.app


Please note: out-of the box ncdu does not display in color.


In order to activate color it is necessary to navigate to – and create if it is not there already – a config file in ~/.config/ncdu/config and add the following to display colors on a dark background and also show hidden files. This can be done by opening the file directly from Cyberduck —> File Menu —> Edit With which will open TextEdit by default but can be configured to open BBEdit from Cyberduck —> Settings —> Editor. Don’t forget to Save and close the file from the remote Mac afterwards.


--color=dark-bg
--show-hidden


ncdu
ncdu in color