自分メモ:home brew update方法

home brewは CentOSのyum、ubuntuのaptと同等の、macOSの「CUIアプリ管理ソフト」です。
大昔に導入したのですがパッケージが古くなり、M1 Macをより快適に使うために、brewのupdateを行いました。
以下自分メモとして記録を残します。


現在のバージョンを調べる
$ brew -v
Homebrew 3.2.0
Homebrew/homebrew-core (git revision 0d1260c4c5; last commit 2021-07-02)
Homebrew/homebrew-cask (git revision f2ce12c029; last commit 2021-07-02)
brewをupdateするも、エラー発生。
$  brew update

--- 省略 ---

meshmixer                                zipcleaner
microsoft-lync                           zoolz
microsoft-r-open

You have 71 outdated formulae installed.
You can upgrade them with brew upgrade
or list them with brew outdated.
Error: Could not link:
/usr/local/share/man/man1/brew.1

Please delete these paths and run:
  brew update
Error: Could not link:
/usr/local/share/doc/homebrew

Please delete these paths and run:
  brew update

brew updateエラーを対処する

$ rm -rf /usr/local/share/doc/homebrew

$ brew update
Already up-to-date.

brew upgradeする

$ brew upgrade

--- 省略 ---

The formula built, but is not symlinked into /usr/local
Could not symlink bin/pango-view
Target /usr/local/bin/pango-view
is a symlink belonging to pango. You can unlink it:
  brew unlink pango

To force the link and overwrite all conflicting files:
  brew link --overwrite pango

To list all files that would be deleted:
  brew link --overwrite --dry-run pango

Possible conflicting files are:
/usr/local/bin/pango-view -> /usr/local/Cellar/pango/1.36.8/bin/pango-view
Error: Could not symlink include/pango-1.0/pango/pango-attributes.h
Target /usr/local/include/pango-1.0/pango/pango-attributes.h
is a symlink belonging to pango. You can unlink it:
  brew unlink pango

To force the link and overwrite all conflicting files:
  brew link --overwrite pango

To list all files that would be deleted:
  brew link --overwrite --dry-run pango


# pangoエラーの回避

$ brew unlink pango

古いアーカイブを削除

$ brew cleanup

Removing: /usr/local/Cellar/pango/1.36.8... (136 files, 4.5MB)
Warning: Skipping pcre2: most recent version 10.39 not installed
Warning: Skipping rav1e: most recent version 0.5.1 not installed
Warning: Skipping rubberband: most recent version 2.0.2 not installed
Warning: Skipping sdl2: most recent version 2.0.20 not installed
Warning: Skipping srt: most recent version 1.4.4 not installed
Warning: Skipping tesseract: most recent version 5.0.1 not installed
Warning: Skipping texi2html: most recent version 5.0 not installed
Warning: Skipping unbound: most recent version 1.13.2_1 not installed
Warning: Skipping vim: most recent version 8.2.4250 not installed
Warning: Skipping watch: most recent version 3.3.17 not installed
Warning: Skipping webp: most recent version 1.2.2 not installed
Warning: Skipping wget: most recent version 1.21.2 not installed
Warning: Skipping winetricks: most recent version 20210825 not installed
Warning: Skipping x264: most recent version r3060 not installed
Warning: Skipping yasm: most recent version 1.3.0_2 not installed
Warning: Skipping zimg: most recent version 3.0.3 not installed
Pruned 203 symbolic links and 13 directories from /usr/local

バージョンの確認

$ brew -v
Homebrew 3.3.13
Homebrew/homebrew-core (git revision 05fe7d7ac9f; last commit 2022-02-04)
Homebrew/homebrew-cask (git revision 71a2e51b77; last commit 2022-02-04)

引用させていただきました。有益な情報をありがとうございます。

最近、macOSのパッケージマネージャーであるHomebrewをアップデートしました。この記事では、Homebrewのアップデート手順を紹介します!Homebrewをアップデートする手順1. brew -vでアップデート前のバージョンをチェ
brew updateした時、以下のエラーが出てupdateできなくなった。Error: Could not link:/usr/local/share/doc/homebrewPlease …