From 030a3f97916024a776e0bc412ee643e95bdcacb7 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Fri, 16 Feb 2024 23:38:21 -0600 Subject: [PATCH] Add Search For Homebrew Packages To Install as a Unix TIL --- README.md | 3 +- ...search-for-homebrew-packages-to-install.md | 33 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 unix/search-for-homebrew-packages-to-install.md diff --git a/README.md b/README.md index cbbdb28..ce11890 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ pairing with smart people at Hashrocket. For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186). -_1367 TILs and counting..._ +_1368 TILs and counting..._ --- @@ -1372,6 +1372,7 @@ _1367 TILs and counting..._ - [Safely Edit The Sudoers File With Vim](unix/safely-edit-the-sudoers-file-with-vim.md) - [Saying Yes](unix/saying-yes.md) - [Search Files Specific To A Language](unix/search-files-specific-to-a-language.md) +- [Search For Homebrew Packages To Install](unix/search-for-homebrew-packages-to-install.md) - [Search History](unix/search-history.md) - [Search Man Page Descriptions](unix/search-man-page-descriptions.md) - [Securely Remove Files](unix/securely-remove-files.md) diff --git a/unix/search-for-homebrew-packages-to-install.md b/unix/search-for-homebrew-packages-to-install.md new file mode 100644 index 0000000..df80ca2 --- /dev/null +++ b/unix/search-for-homebrew-packages-to-install.md @@ -0,0 +1,33 @@ +# Search For Homebrew Packages To Install + +Let's say we want to install the latest version of PostgreSQL with `brew`, but +we aren't sure either what formulas are available nor what the exact name would +be. + +We can run a search with the `brew search` subcommand to get an idea of what is +available. + +If I run this for even the shorthand of `postgres`, I get a useful set of +results showing me what versions I already have installed and what else is +available. + +```bash +$ brew search postgres +==> Formulae +check_postgres postgresql@11 ✔ postgresql@13 postgresql@15 postgrest postgis +postgresql@10 postgresql@12 postgresql@14 postgresql@16 qt-postgresql + +==> Casks +navicat-for-postgresql postgres-unofficial sqlpro-for-postgres +postbird postgrespreferencepane + +If you meant "postgres" specifically: +postgresql breaks existing databases on upgrade without human intervention. + +See a more specific version to install with: + brew formulae | grep postgresql@ +``` + +I can then go on to run `brew install postgresql@16` to get the latest. + +See `brew search --help` for more details.