cd /usr/localgit status- Discard all the changes (unless you actually want to try to commit to Homebrew - you probably don't)
git statustil it's cleanbrew update
Homebrew users — reminder to update and upgrade (plus other neat things you can do from the command line)
macos - How to update packages installed via Homebrew? - Ask Different
looking for forgotten brew command
Is there no fix for Homebrew on Sonoma??
cd /usr/localgit status- Discard all the changes (unless you actually want to try to commit to Homebrew - you probably don't)
git statustil it's cleanbrew update
tl;dr: brew update && brew upgrade
Homebrew is the "missing package manager for macOS (or Linux)". Probably most people don't need it, but it's really helpful for people who like using command line tools, programmers, and Linux fans. I'm not here to persuade anyone to use it, I just want to remind people who do to occasionally update/upgrade. Maybe that's obvious, but I spent an embarrassingly long time forgetting to update.
Here are the two most relevant commands.
-
brew update- Update brew itself and fetches info about what's available for your other software -
brew upgrade- Upgrade/update everything you've installed with Homebrew
Here are some others.
-
brew list- Display software you've installed -
brew cask list- Display GUI apps you've installed -
brew cask upgrade- Update GUI apps you've installed (u/_zio_pane) -
brew outdated- Display available updates -
brew upgrade whatever_package- Upgrade only a specific thing -
brew cleanup- Remove old versions -
brew leaves- Shows only packages you installed without their dependencies (u/geniuscube)
[That's all this post was going to be, but my original "quick list of neat things to try" below turned into a huge list.]
Here are some random things you can install with Homebrew. (to install any of these, it's brew install whatever)
-
youtube-dl- download video or audio from YouTube - (and a LOT of other sites (u/frozenpandaman)) -
ffmpeg- media transcoder - youtube-dl uses this automatically if the format you want from YouTube isn't directly available -
tldr- more useful and to-the-point way to get info and example uses for commands (better than digging through 100 pages withman) -
gnu-typist- fun typing tutor. I used this when I switched from QWERTY to Colemak layout, but someone could have fun with this just to get faster with the regular QWERTY layout. -
neofetch- shows OS and shell info, you see this a lot in r/unixporn screenshots (by the way, macOS is a real, certified Unix, with BSD heritage) -
rename- better thanmvfor batch-renaming files -
fortune- gives you your fortune for the day/moment -
cowsay- have a cow say things -fortune | cowsaywill let the cow provide your fortune -
coreutils- the official GNU versions of core utilities likemv,cp,ls,chown,chroot,cat,head, etc, so you can be sure they behave in exactly the same way as on Linux and other systems -
zshorfish- better bash-compatible shells with better command completion and history - fish has slightly better completions but also a few annoying breaks from bash syntax. I've used fish for the last 3 years, but after taking that screenshot I think I'm going back to zsh. -
bash-completion- or you can just make bash itself better with this -
iterm2- a better Terminal (GUI app) -
GUI browsers like
firefoxandgoogle-chrome -
linksandlynx- text mode browsers -
kotlin,lua,node,perl,python3,ruby- programming/scripting languages - installingnodealso gives younpm, the node.js package manager -
neovim- a slightly bettervim(text editor), but you can also just installvimto get a newer version than what ships with macOS -
flacandopus- media codecs, andmpv- a media player -
sox- also automatically installs the tool/commandplaywhich can play media directly in the terminal, as simple asplay song.mp3orplay *.mp3to play a whole folder, one at a time. It can also synthesize white or pink noise, and apply filters. For example, this is great at blocking speech by mimicking the sound of hundreds of people talking in a coliseum (plus a fountain, maybe), to help you focus:play -c 2 -n synth pinknoise mix synth sine amod 0.07 90 band -n 2000 1q vol 0.9 -
-c 2creates two channels (stereo) (not needed when playing a file that's already stereo) -
-n synth pinknoisemakes it synthesize pink noise -
mix synth sine amod 0.07 90makes it slowly cycle loudness between 100% and 90% at a rate of 0.07 cycles per second (a little over 14 seconds for a full cycle) -
band -n 2000 1qcreates a bandpass filter centered at 2khz with a "Q" of one, where lower numbers (like 0.5) make it more relaxed/wider and higher numbers (like 2 or 4) make it tighter -
vol 0.9sets the volume to 90%
One more practical example, you can download the audio from rain and fire videos with youtube-dl in a format like mp3 or opus, and then play them both at the same time like this:
# Fire & Wind Storm youtube-dl --list-formats "https://www.youtube.com/watch?v=BA0yeSB7s4o" youtube-dl -f 251 -x "https://www.youtube.com/watch?v=BA0yeSB7s4o" mv Crackling*-BA0yeSB7s4o.opus fire_wind_storm.opus # Heavy Rain in Car youtube-dl --list-formats "https://www.youtube.com/watch?v=DYrvIKpo3fI" youtube-dl -f 251 -x "https://www.youtube.com/watch?v=DYrvIKpo3fI" mv 10hrs*-DYrvIKpo3fI.opus heavy_rain_in_car.opus # Play them together play -m fire_wind_storm.opus heavy_rain_in_car.opus
If you're only trying to upgrade one package:
brew upgrade package_name
All packages
brew update && brew outdated && brew upgrade && brew cleanup
Note, I had to add my own answer for this since I got here looking for just one, and noticed the top answer had brew upgrade --cask, while I got the following from here:
During 2020 the sub-commands of the cask command were gradually integrated into the core of Homebrew and were deprecated. The core commands now operate on both formulae and casks. To limit their scope to only formulae or casks add the --formula or --cask option to the command line.
The cask command has been completely removed from Homebrew in version 2.6.0, released in December 2020.
There is a unified flow now for both formulae and casks:
brew update
brew outdated
brew upgrade
The first command (brew update) gets from the Homebrew servers the information about the most recent versions of the available formulae and casks.
The second command (brew outdated) lists the outdated installed formulae and casks. Add --formulae or --casks to the command line to limit the command scope to formulae or casks. Add --greedy to the command line to include in its output the casks that are marked as "auto-updateable".
This command is not needed. It can be used to see what programs will be upgraded before doing the actual upgrade.
The third command (brew upgrade) upgrades the packages listed by brew outdated. It also supports the options listed above for brew outdated and operates accordingly.
To have your packages and apps you just need to run these commands in your terminal:
brew update && brew upgrade && brew upgrade --cask && brew cleanup