My Dump of Brew Cheats
1 Prerequisites
To install brew, you need to run: ruby -e "\((curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ruby -e "\)(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Once brew is installed you can install wget, then youtube-dl etc.
2 Commands:
brew help
: obvious, that is top
brew -v
: verify installation good
brew info emacs
: display information about brew's installed version of emacs
brew list
: shows a list of installed packages
brew update
: – Fetch the newest version of Homebrew and all formulae from GitHub using git.
brew upgrade [formulae]
– Upgrade outdated formulae. This can take an optional argument if you only want to update one formulae
brew uninstall <formulae>
– uninstall a specific formulae
brew install
brew prune
: cleans up unlinked files (I think)
brew cleanup
: not sure
brew doctor
: does a health check on your brew install * very useful
brew unlink python
These two were needed to get pip working. It was
downloaded with Python 3.7.4, but which pip did not find it.
brew link python
Also please see python.org on duplication of work when pyenv installs python. Under section titled: "Issue when brew upgrade clobbered 3.7.4".
With all this awesomeness, it's easy to forget that these tools need to be polished and maintained to perform correctly. I'll make it easy for you with a few aliases I created:
alias brewup = 'brew update; brew upgrade; brew prune; brew cleanup; brew doctor'
2.0.1 Some issues with brew upgrade and python version
I tried to upgrade my venv python 3.10, but when I tried to brew upgrade
brew found
and upgraded 3.9 from 3.9.8 to 3.9.9 and ignored 3.10. Even though I was
in the 3.10 venv
.
According to this stack Exchange link,
"Formula updates don't necessarily mean the software which formula installs is updated. So, running brew upgrade without other parameters will bring brews which are outdated up to date whereas running brew upgrade <specific brew> might produce an error in case it's only the formula and not the brew which has been updated."
But that does not help me.
3 Same Commands
Commands brew install git Install a package brew upgrade git Upgrade a package brew unlink git Unlink brew link git Link brew switch git 2.5.0 Change versions brew list –versions git See what versions you have
brew info git List versions, caveats, etc brew cleanup git Remove old versions brew edit git Edit this formula brew cat git Print this formula brew home git Open homepage Global commands
brew update Update brew and cask brew list List installed brew outdated What’s due for upgrades?
% brew upgrade pyenv Updating Homebrew... ==> Upgrading 1 outdated package: pyenv 1.2.8 -> 1.2.11 ==> Upgrading pyenv ==> Installing dependencies for pyenv: readline ==> Installing pyenv dependency: readline ==> Downloading https://homebrew.bintray.com/bottles/readline-8.0.0_1.mojave.bottle.tar.gz . . . ==> Pouring readline-8.0.0_1.mojave.bottle.tar.gz ==> Caveats readline is keg-only, which means it was not symlinked into /usr/local, because macOS provides the BSD libedit library, which shadows libreadline. In order to prevent conflicts when programs look for libreadline we are defaulting this GNU Readline installation to keg-only. For compilers to find readline you may need to set: setenv LDFLAGS -L/usr/local/opt/readline/lib; setenv CPPFLAGS -I/usr/local/opt/readline/include; For pkg-config to find readline you may need to set: setenv PKG_CONFIG_PATH /usr/local/opt/readline/lib/pkgconfig;
4 Brew list old and new
old mbp | new mp | date added |
---|---|---|
ansible | ||
autoconf | autoconf | Aug 15 |
emacs | ||
fontconfig | ||
freetype | ||
gd | ||
gdbm | gdbm | Aug 15 |
gettext | gettext | Aug 15 |
git | Aug 15 | |
glib | ||
gmp | ||
gnutils | ||
grpahviz | ||
gts | ||
htop | ||
jasper | ||
jpeg | ||
kubernetes-cli | ||
libevent | ||
libffi | ||
libpng | ||
libtasn1 | ||
libtiff | ||
libtool | ||
libunistring | ||
libyaml | ||
ncurses | ||
netpbm | ||
nettle | ||
openssl | openssl | Aug 15 |
p11-kit | ||
pcre | pcre2 | Aug 15 |
pkg-config | pkg-config | Aug 15 |
pyenv | pyenv | Aug 15 |
python | python | Aug 15 |
python@2 | ||
readline | readline | Aug 15 |
socat | ||
sqlite | sqlite | Aug 15 |
webp | ||
xz | xz | Aug 15 |
youtube-dl | Aug 15 | |
zlib | zlib | Aug 15 |