Homebrew を使って Macbook に Wget をインストール

OS:Mac OS Catalina バージョン 10.15.4

「brew update」でリスト更新

まずはターミナル上で「brew update」を実行し、Homebrew 自体とインストール可能なソフトウェアのリストを更新します。

~ % brew update
Updated 1 tap (homebrew/core).
==> Updated Formulae
acpica              imagemagick         nss                 solr
atlantis            imagemagick@6       onnxruntime         solr@7.7
efl                 kyma-cli            operator-sdk        stellar-core
evince              lazydocker          pandoc-crossref     terragrunt
exploitdb           lerna               picard-tools        vault
fcct                librsvg             plantuml            vim
firebase-cli        mavsdk              pnpm                vte3
gatsby-cli          mu                  prestosql           watson
helmfile            ncdu                re-flex
hlint               node-sass           redis
~ % 

「brew install wget」で Wget をインストール

ターミナル上で「brew install wget」を実行すると、Wget のインストール処理が始まります。

~ % brew install wget
==> Downloading https://homebrew.bintray.com/bottles/gettext-0.20.2_1.catalina.b
==> Downloading from https://akamai.bintray.com/71/71f4ded03e8258b5e6896eebb00d2
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/libunistring-0.9.10.catalin
==> Downloading from https://akamai.bintray.com/ce/ce746662b98d93511b86920011b5c
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/libidn2-2.3.0.catalina.bott
==> Downloading from https://akamai.bintray.com/09/0908585cca518a83f101b2edc0417
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/openssl%401.1-1.1.1g.catali
==> Downloading from https://akamai.bintray.com/19/1926679569c6af5337de812d86f4d
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/wget-1.20.3_2.catalina.bott
==> Downloading from https://akamai.bintray.com/ef/ef65c759c5097a36323fa9c777564
######################################################################## 100.0%
==> Installing dependencies for wget: gettext, libunistring, libidn2 and openssl@1.1
==> Installing wget dependency: gettext
==> Pouring gettext-0.20.2_1.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/gettext/0.20.2_1: 1,923 files, 18.6MB
==> Installing wget dependency: libunistring
==> Pouring libunistring-0.9.10.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/libunistring/0.9.10: 54 files, 4.4MB
==> Installing wget dependency: libidn2
==> Pouring libidn2-2.3.0.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/libidn2/2.3.0: 70 files, 727.8KB
==> Installing wget dependency: openssl@1.1
==> Pouring openssl@1.1-1.1.1g.catalina.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /usr/local/etc/openssl@1.1/certs

and run
  /usr/local/opt/openssl@1.1/bin/c_rehash

openssl@1.1 is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.

If you need to have openssl@1.1 first in your PATH run:
  echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc

For compilers to find openssl@1.1 you may need to set:
  export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
  export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"

==> Summary
🍺  /usr/local/Cellar/openssl@1.1/1.1.1g: 8,059 files, 18MB
==> Installing wget
==> Pouring wget-1.20.3_2.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/wget/1.20.3_2: 50 files, 4.0MB
==> Caveats
==> openssl@1.1
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /usr/local/etc/openssl@1.1/certs

and run
  /usr/local/opt/openssl@1.1/bin/c_rehash

openssl@1.1 is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.

If you need to have openssl@1.1 first in your PATH run:
  echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc

For compilers to find openssl@1.1 you may need to set:
  export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
  export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"

~ % 

入力待ち状態になったら完了です。途中ビールのアイコンが表出されるのかわいいですね。

「wget --version」で確認

インストールが完了した後、ターミナルで「wget --version」を実行すると、Wget のバージョン情報や著作権に関する案内、バグ報告の質問の連絡先が表出されます。

~ % wget --version
GNU Wget 1.20.3 built on darwin19.0.0.

-cares +digest -gpgme +https +ipv6 +iri +large-file -metalink +nls 
+ntlm +opie -psl +ssl/openssl 

Wgetrc: 
    /usr/local/etc/wgetrc (system)
ロケール: 
    /usr/local/Cellar/wget/1.20.3_2/share/locale 
コンパイル: 
    clang -DHAVE_CONFIG_H -DSYSTEM_WGETRC="/usr/local/etc/wgetrc" 
    -DLOCALEDIR="/usr/local/Cellar/wget/1.20.3_2/share/locale" -I. 
    -I../lib -I../lib -I/usr/local/opt/openssl@1.1/include -DNDEBUG -g 
    -O2 
リンク: 
    clang -DNDEBUG -g -O2 -lidn2 -L/usr/local/opt/openssl@1.1/lib -lssl 
    -lcrypto -ldl -lz ftp-opie.o openssl.o http-ntlm.o ../lib/libgnu.a 
    -liconv -lintl -Wl,-framework -Wl,CoreFoundation -lunistring 

Copyright (C) 2015 Free Software Foundation, Inc.
ライセンス GPLv3+: GNU GPL バージョン 3 あるいはそれ以降のバージョン
<http://www.gnu.org/licenses/gpl.html>.
このソフトウェアはフリーソフトウェアです。自由に変更、再配布ができます。
法律が許すかぎり、全くの無保証です。

Hrvoje Niksic <hniksic@xemacs.org> によって書かれました。
バグ報告や質問は<bug-wget@gnu.org>へ
~ % 

Homebrew を Macbook Pro へインストール

Homebrew を Macbook へインストールする際のステップです。

OS:Mac OS Catalina バージョン 10.15.4

Homebrew 公式サイトでインストール用スクリプトをコピー&ターミナルへペースト

Homebrew の公式サイトへアクセス。

トップページに表示されているコードをコピーし、ターミナルへペースト&「Enter」
*コードは 2020 年 5 月時点のものです。

~ % /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

インストールがスタート

するとまず下記の通りインストール時に何が起こるかの説明が表示されます。

==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following existing directories will be made group writable:
/usr/local/bin
/usr/local/lib
/usr/local/share
==> The following existing directories will have their owner set to *****:
/usr/local/bin
/usr/local/lib
/usr/local/share
==> The following existing directories will have their group set to admin:
/usr/local/bin
/usr/local/share
==> The following new directories will be created:
/usr/local/etc
/usr/local/include
/usr/local/sbin
/usr/local/var
/usr/local/opt
/usr/local/share/zsh
/usr/local/share/zsh/site-functions
/usr/local/var/homebrew
/usr/local/var/homebrew/linked
/usr/local/Cellar
/usr/local/Caskroom
/usr/local/Homebrew
/usr/local/Frameworks
==> The Xcode Command Line Tools will be installed.

Press RETURN to continue or any other key to abort

そのままリターンキーを叩くとパスワード確認後インストールへ。他のキーを叩くと切断されます。ということでリターンキーをポチ。

==> /usr/bin/sudo /bin/chmod u+rwx /usr/local/bin /usr/local/lib /usr/local/share
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/bin /usr/local/lib /usr/local/share
==> /usr/bin/sudo /usr/sbin/chown ***** /usr/local/bin /usr/local/lib /usr/local/share
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/bin /usr/local/share
==> /usr/bin/sudo /bin/mkdir -p /usr/local/etc /usr/local/include /usr/local/sbin /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/etc /usr/local/include /usr/local/sbin /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /usr/sbin/chown ***** /usr/local/etc /usr/local/include /usr/local/sbin /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/etc /usr/local/include /usr/local/sbin /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /bin/mkdir -p /Users/*****/Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Users/*****/Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown ***** /Users/*****/Library/Caches/Homebrew
==> Searching online for the Command Line Tools
==> /usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> Installing Command Line Tools for Xcode-11.5
==> /usr/bin/sudo /usr/sbin/softwareupdate -i Command\ Line\ Tools\ for\ Xcode-11.5
Software Update Tool


Downloading Command Line Tools for Xcode

上記の最後の行、「Xcode 用のコマンドラインツールをダウンロードしています」で一旦止まりますがそのまま待ちます。

その後下記の様な表示がされます。

Downloading Command Line Tools for Xcode
Downloaded Command Line Tools for Xcode
Installing Command Line Tools for Xcode
Done with Command Line Tools for Xcode
Done.
==> /usr/bin/sudo /bin/rm -f /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
Password:

Xcode 用 コマンドラインツールのダウンロード&インストールの完了、そしてパスワードを再度求められます。

パスワードを入力すると再度処理が始まりズラズラっとターミナル上に表出されていきます。

「==> Installation successful!」と表示されてインストール完了

Password:
==> /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools
==> Downloading and installing Homebrew...
remote: Enumerating objects: 68, done.
remote: Counting objects: 100% (68/68), done.
remote: Compressing objects: 100% (64/64), done.
remote: Total 137483 (delta 5), reused 55 (delta 4), pack-reused 137415
Receiving objects: 100% (137483/137483), 33.39 MiB | 346.00 KiB/s, done.
Resolving deltas: 100% (101071/101071), done.
From https://github.com/Homebrew/brew
 * [new branch]      master     -> origin/master
 * [new tag]         2.3.0      -> 2.3.0
〜一部省略〜
 * [new tag]             2.2.9      -> 2.2.9
HEAD is now at 77e09fc16 Merge pull request #7661 from MikeMcQuaid/man-url-install
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations
==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Enumerating objects: 726765, done.
remote: Total 726765 (delta 0), reused 0 (delta 0), pack-reused 726765
Receiving objects: 100% (726765/726765), 294.50 MiB | 324.00 KiB/s, done.
Resolving deltas: 100% (480049/480049), done.
Tapped 2 commands and 5029 formulae (5,298 files, 322.8MB).
Already up-to-date.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics
No analytics data has been sent yet (or will be during this `install` run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations

==> Next steps:
- Run `brew help` to get started
- Further documentation: 
    https://docs.brew.sh
~ % 

上記の中盤過ぎに「==> Installation successful!」と表示が出ているので問題なく処理が完了した様です。

「ターミナルで brew help と入力すればいくつか情報が得られるし、https://docs.brew.sh にもより詳細な情報があるよ」とのこと。ちなみに「brew help」を実行すると下記の内容が表示されます。

~ % brew help
Example usage:
  brew search [TEXT|/REGEX/]
  brew info [FORMULA...]
  brew install FORMULA...
  brew update
  brew upgrade [FORMULA...]
  brew uninstall FORMULA...
  brew list [FORMULA...]

Troubleshooting:
  brew config
  brew doctor
  brew install --verbose --debug FORMULA

Contributing:
  brew create [URL [--no-fetch]]
  brew edit [FORMULA...]

Further help:
  brew commands
  brew help [COMMAND]
  man brew
  https://docs.brew.sh

いまいちよく分からないですね!ひとまず一旦無視して追々必要に応じて調べていこうと思います。

「brew --version」で最終確認

ターミナルに「brew --version」と入力して Enter。ちゃんとどのバージョンがインストールされているか表示されています。ということでインストールはOKです。

~ % brew --version
Homebrew 2.3.0
Homebrew/homebrew-core (git revision 2adae5; last commit 2020-05-30)
~ %