One Command Developers on MacOS Should Run Every Day

Photo by Kaitlyn Baker on Unsplash

Staying on top of your development game means keeping good habits. Here is one tip I always tell people on how to keep your development machine up to date with software so that your next install is speedy.

Update Brew

When you need to install something from homebrew and you haven’t updated in a long time, the process can take a long time, sometimes as long as 10 minutes. When I’m pairing with a developer and we need to install something to troubleshoot an issue, like redis-server or openssl, I find myself typing brew install openssl only to watch homebrew look for updates, download updates, and then install out of date decencies for way too long. Here’s how you can avoid that.

Every day, when you open your terminal, or you have access to your terminal, let’s say at the start of a meeting where you won’t need your terminal, run this command:

brew update && brew outdated && brew upgrade && brew cleanup

If you run this daily, it will take only a few minutes if there are updates. Running this incrementally will make the update process very short overall. The next time you need to install software, it will be a very quick installation experience, since there won’t be a long list of updates to install. You also will experience a significantly less buggy development experience, since you will always have the latest stable versions of the software you depend on.

Update Brew Casks

If you install GUI apps with homebrew, like I do, then keeping them up to date with homebrew is a pretty straight forward process. You can run this one liner as well to find updates and install them.

brew update && brew cask reinstall $(brew cask outdated) && brew cleanup

While there's no simple way to update installed casks from one place, this is the closest solution, and it works pretty well. I like it because it keeps the cask-stored version of the app up to date as well, which acts as a universal source of truth.

Install the OhMyZsh plugin

If you don’t want to remember all of those commands, you can save them as aliases. But you don’t have to. the brew plugin for OhMyZsh creates all of these aliases for you. All you have to remember is bubu and bcubc to reap the benefits of both of these commands.