|||

0103-using-brew-bundle-to-backup-and-restore-mac-app-store-and-brew-apps

Brew Bundle

Per the Bundle github README, Bundler is a [1] Bundler for non-Ruby dependencies from Homebrew, Homebrew Cask, Mac App Store(MAS) and Whalebrew.”

Brew bundle creates a text file called Brewfile listing all the currently installed applications managed via Brew and the Mac App Store. This Brewfile can be used as a backup and gives you the ability to restore applications when reinstalling macOS or setting up a new environment.

The screenshots below are from the Bundle Brew Documentation page. [2]

Bundle Installation

The first time the command, brew bundle, is run it will install, if not already.

brew bundle

Bundle Backup to Brewfile

To create the Brewfile use the command, brew bundle dump, and a text file with all the Brew, Mac App Store apps, and their dependancies will be created in the current directory.

brew bundle dump

The below Brewfile contains all the installed Brew and MAS apps

Bundle Check and List

Using command, brew bundle check, will check to see if all dependancies are installed from the Brewfile. The command, brew bundle list, will list all the dependancies present in a Brewfile.

brew bundle list
brew bundle check 

Bundle Restore from Brewfile

The command, brew bundle install, will use the Brewfile in the current directory and install any application listed, but not currently installed.

In this example the brew cask application atom was added to the dumped Brewfile, and when the install command is run it installed atom.

brew bundle install

Bundle Cleanup

Using the command, brew bundle cleanup, will remove any apps installed, but not listed in the Brewfile.

In the below screenshots atom was removed from the Brewfile. When the command, brew bundle cleanup, the output shows what will be uninstalled. To actually uninstall the apps, use the command brew bundle cleanup –force.

brew bundle cleanup
brew bundle cleanup --force

Resources:

  1. brew bundle https://github.com/Homebrew/homebrew-bundle.git

  2. brew documentation bundle subcommand https://docs.brew.sh/Manpage#bundle-subcommand

Up next Update macOS with an all in one alias 0105-free-git-ebook
Latest posts 0104-change-synology-password-cli 0105-free-git-ebook 0103-using-brew-bundle-to-backup-and-restore-mac-app-store-and-brew-apps Update macOS with an all in one alias Mac App Store Command Line Interface 0100-macos-softwareupdate-cli Markdown Crash Course Video What’s New with Fusion and Workstation [HCP1833] File IO in Python Overview of vSphere 7 Video 0095-what_is_iso Migrating Website HTML details Tag Microsoft RD Client iOS App 0091-create_vmware_esxi_usb_install_media Intel NUC Lab Hosts Hardware Setup 0089-installng_microsoft_sql_2016 Installing the First Two Domain Controllers in the VMware ESXi 6.7 Lab Environment 0088-deploy_vcsa_in_lab Macchanger Utility, and Usage Install a Kali Linux VM in a VMware ESXi 6.7 Environment Install Ubuntu 18.04 Virtual Machine in a VMware ESXi 6.7 Environment Install xRDP on Ubuntu 18.04 Install Chromium on Ubuntu 18.04 Install OpenSSH on Ubuntu 18.04 Install VMware Workstation 14 on Ubuntu 18.04 Nested ESXi server Laboratorium Rattus The Animal Within Who is Veeam? RSAC OnDemand Videos 0075-create_win10_sandbox_vm