HOWTOlabs Homebrew
Package Management Tips to augment Apple MacOS

Related [edit]

Elsewhere

Apple MacOS does not have a well defined package management system for tracking software modules that are added, removed, and updated.  Although the App Store and the System Preference > Software Update features of MacOS suggest some sort of package manager is being used, it is not exposed for users to access except for major system updates and for installing only officially offered products from the App Store.

Homwbrew is a effort to build a package management system to augment MacOS, primarily aimed at managing simple command line tools and software library support.  It tried to keep everything isolated from the internal of MacOS, allowing software to added, removed, and updated without interfering with the MacOS underlying software from Apple.

This is an advanced tool, and best used only by users who are accomplished working with complex software, using the command line, and who have no other way to use Apple's Tools and App Store offerings to perform certain tasks. 

https://osxdaily.com/2018/10/20/how-list-all-homebrew-packages-installed-mac/

https://en.wikipedia.org/wiki/MacOS_Catalina
https://en.wikipedia.org/wiki/MacOS_Big_Sur

https://support.apple.com/en-us/HT211683

https://discourse.brew.sh/t/brew-update-homebrew-core-is-a-shallow-clone/9300/5



$ brew list

  libevent  ncurses  openssl@1.1  tmux

$ brew info ncurses

  ncurses: stable 6.2 (bottled) [keg-only]
  Text-based UI library
  https://www.gnu.org/software/ncurses/
  /usr/local/Cellar/ncurses/6.1 (3,869 files, 8.3MB)
  Poured from bottle on 2020-01-20 at 19:20:46
  From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/ncurses.rb
  License: MIT
  ==> Dependencies
  Build: pkg-config ✘
  ==> Caveats
  ncurses is keg-only, which means it was not symlinked into /usr/local,
  because macOS already provides this software and installing another version in
  parallel can cause all kinds of trouble.
  ...  
Using certbot
$ xcode-select --install

  [ optional, must be done from actual machine (not remotely)
    in case your command line tools are not current ]

$ brew install certbot

  [ or if already installed ]

$ brew upgrade certbot

$ sudo certbot certonly --apache

  [ first time is will ask for email to support EFF
    choose the number of the domain to get a cert for ]

$ sudo certbot renew

  [ this should only refresh soon to expire domain certificates,
    note, webserver typically needs to be restarted afterward ]  

On MacOS, often the web server may have trouble reading the /etc/letsencrypt certification files.  To help debug if this is happening, try chmod 755 on both the archive and live folders, see if that improves things.

<VirtualHost *:443>
DocumentRoot "/.../howto/blog/site"
ServerName blog.howtolabs.net:443
ServerAdmin info@zaptech.com
ErrorLog "/private/var/log/apache2/blog.howtolabs.net-https_error.log"
TransferLog "/private/var/log/apache2/blog.howtolabs.net-ssl_request.log"
SSLEngine on
SSLCertificateChainFile "/etc/letsencrypt/live/blog.howtolabs.net/chain.pem"
SSLCertificateKeyFile   "/etc/letsencrypt/live/blog.howtolabs.net/privkey.pem"
SSLCertificateFile      "/etc/letsencrypt/live/blog.howtolabs.net/cert.pem"
<FilesMatch "\.(cgi|shtml|phtml|php)$">
    SSLOptions +StdEnvVars
</FilesMatch>
CustomLog "/private/var/log/apache2/ssl_request_log" \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>  

brew

Elsewhere

MacOS remains a variant of the legacy UNIX operating system which has many open source equivalents in the Linux community.  MacOS includes by default many Unix/Linux comamnd line tools and packages, but not all.  Typically only developers may need to leverage certain Unix/Linux tools on MacOS that are not already provided by Apple.  In those rare cases several 'package managers' that augment Apple's own App Store can provide reasonably straight forward ways to pull in missing tools and services.  By far the most popular one as of 2018 is brew.

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  ==> This script will install:
  /usr/local/bin/brew
  ...
  ==> The following existing directories will be made group writable:
  /usr/local/bin
  ==> The following existing directories will have their owner set to rickatech:
  /usr/local/bin
  ==> The following existing directories will have their group set to admin:
  /usr/local/bin
  ==> The following new directories will be created:
  /usr/local/Cellar
  ...
  ==> /usr/bin/sudo /bin/chmod u+rwx /usr/local/bin
  Password:
  ...
  ==> Installation successful!

$ brew help

  ...

$ brew search 

  a2ps
  ...
  zzz

$ brew search rcs

  ==> Searching local taps...
  rcs

$ brew install rcs

$ which rcs

  /usr/local/bin/rcs

$ ls -lh /usr/local/bin

  brew -> /usr/local/Homebrew/bin/brew
  ci -> ../Cellar/rcs/5.9.4_1/bin/ci
  co -> ../Cellar/rcs/5.9.4_1/bin/co
  gpg -> /usr/local/MacGPG2/bin/gpg2
  ident -> ../Cellar/rcs/5.9.4_1/bin/ident
  merge -> ../Cellar/rcs/5.9.4_1/bin/merge
  rcs -> ../Cellar/rcs/5.9.4_1/bin/rcs
  rcsclean -> ../Cellar/rcs/5.9.4_1/bin/rcsclean
  rcsdiff -> ../Cellar/rcs/5.9.4_1/bin/rcsdiff
  rcsmerge -> ../Cellar/rcs/5.9.4_1/bin/rcsmerge
  rlog -> ../Cellar/rcs/5.9.4_1/bin/rlog