List removed formulae

When I ran brew upgrade I saw that python@2 was listed as removed formula. Which prompted me to remove it manually, as I don’t need it anymore.

Is there any way to get a list of installed formula that have been removed from the brew repo? I wonder how many similar ones I’ve missed in the past and would like to make sure all installed formulae are current. I’ve trawled through the docs but can’t find anything.

First thing I thought of:
brew leaves | xargs -n1 brew info

List out every formula that’s not depended upon by another, and try and get info – if it can’t get info, the formula no longer exists. (I think?)

@chuckdbacon there’s no officially supported way but this is a good idea so I think I’ll consider doing so, thanks!

1 Like

Genius, thanks. Switched it to list & added a grep so I didn’t have to try to track the output.

brew list | xargs -n1 brew info 2>&1 | grep 'was deleted from'

Not tested successfully yet as main machine I already removed python@2, and secondary machine has a confused homebrew install that claims to be up to date but doesn’t realise python@2 has been removed :man_shrugging:.

Confused homebrew install might be fixed by resetting it completely using brew update-reset

Oh nice hadn’t seen that command. Just tried but didn’t clear out python@2 in this case. I did a complete removal and reinstall -

brew bundle dump
<uninstall & install commands from site>
brew bundle

Turned up wine & python@2 deleted packages that had been installed.

1 Like