#author("2023-04-22T07:20:55+00:00","default:hotate","hotate") #author("2023-06-04T00:21:03+00:00;2023-04-22T07:20:55+00:00","default:hotate","hotate") #contents &tag(Homebrew, macOS); &tag(Homebrew,macOS); * バージョン [#m419351e] ** 4.0 [#n1a95030] - [[パッケージマネージャー「Homebrew」のバージョン4.0.0が登場|CodeZine(コードジン)>https://codezine.jp/article/detail/17413?]] (2023/02/28) 今回の新バージョンから「Homebrew Formulae」でJSONファイルをダウンロードし、その内容を見てソフトウェアをインストールするようになった。 ** 2.0 [#vcd54824] - [[macOS用パッケージマネージャ「Homebrew 2.0」リリース。LinuxとWSL(Windows Subsystem for Linux)にも正式対応 - Publickey>https://www.publickey1.jp/blog/19/macoshomebrew_20linuxwslwindows_subsystem_for_linux.html]] macOSだけでなく、「Linux」とWindows 10のLinux互換機能である「Windows Subsystem for Linux」にも正式に対応しました。 - [[Homebrew 2.0.0リリース: Linuxbrewの統合>https://rcmdnk.com/blog/2019/02/08/computer-mac-linux-homebrew/]] 公式Formulaからはオプションがなくなった ** 1.9 [#j709e6fd] - [[Mac用パッケージマネージャー「Homebrew v1.9」がリリース。32-bit CPUが非サポートとなり、今後LinuxとWindows 10にも対応へ。 | AAPL Ch.>https://applech2.com/archives/20190110-homebrew-v1-9-support-linux-and-windows.html]] “HOMEBREW_INSTALL_CLEANUP”値が設定されている場合は”brew reinstall/install/upgrade”時に定期的に”brew cleanup”を実行するように仕様が変更され、”brew cleanup”を行わず知らないうちにキャッシュで数GBのディスク容量が消費されているという問題にも対策が行われた * 導入 [#l1993053] - [[macOS(またはLinux)用パッケージマネージャー — Homebrew>https://brew.sh/index_ja]] /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ** [[El Capitan]] [#nf79d45a] - [[OS X El Capitan で Homebrew を使う方法 - 意識低い開発者のBlog>https://blog.ymyzk.com/2015/10/os-x-el-capitan-homebrew/]] /usr/local のパーミッションを変更すれば OK です. sudo chown -R $(whoami):admin /usr/local ** [[Yosemite]] [#q8a81d21] - [[MacにHomebrewをインストールする>http://qiita.com/_daisuke/items/d3b2477d15ed2611a058]] $ xcode-select --install ** [[MountainLion]] [#gfd85169] - [[Mac - Mountain Lion環境への「Homebrew」のインストール手順 - Qiita [キータ]>http://qiita.com/skinoshita/items/fd146ac223bab433b348]] * コマンド [#xfebc462] - [[Homebrew使い方まとめ - Qiita>https://qiita.com/vintersnow/items/fca0be79cdc28bd2f5e4]] mac用のパッケージマネージャーであるHomebrewのコマンド一覧です。 - [[Homebrewの導入と使い方 | CAPH TECH>http://tech.caph.jp/2011/04/06/homebrew%E3%81%AE%E5%B0%8E%E5%85%A5%E3%81%A8%E4%BD%BF%E3%81%84%E6%96%B9/]] - [[Macのパッケージ管理をMacPortsからhomebrewへ - よんちゅBlog>http://yonchu.hatenablog.com/entry/20110226/1298723822]] Formulaの格納先 /usr/local/Library/Formula - 更新が終わったら通知センターで知らせる $ brew update && brew outdated && osascript -e 'display notification "Homebrew updated"' ** バージョン変更 [#td5844bf] - [[Homebrewで過去のバージョンを使いたい【tap版】 - Carpe Diem>https://christina04.hatenablog.com/entry/install-old-version-with-homebrew]] 対応方法 brew extractで旧バージョンのformulaを独自tapに登録してそこからインストールします。 -- コメント:上記の方法で旧バージョンをインストール出来た。実例は[[MySQL/トラブル>MySQL/トラブル#ra349221]]を参照。(2021/06/20) - %%[[Homebrewで旧バージョンをインストールする方法(brew versionsはもう使えない) - Qiita>https://qiita.com/honeniq/items/778cc08d2db78e6774d8]]%% brew versionsコマンドが使えなくなっていたのが一番困ったので、対処法についてまとめます。 -- コメント:現在のパスは下記を参照 (2019/08/09) /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ - %%[[homebrewで過去のバージョンインストールする方法 - Qiita>https://qiita.com/ShuntaShirai/items/c582c0acebe2dbf03fc3]]%% homebrewにはパッケージをバージョン指定をしてインストールするコマンドがありません。なので git checkout を使って目的のバージョンのimagemagickをインストールします。 - %%[[homebrewで複数versionはいってるformulaをきりかえるには - marutanmlog>http://marutanm.github.io/blog/2012/02/01/homebrew-switch-formula-version/]]%% homebrewには外部コマンドという位置づけでhelpには載ってないコマンドがいくつかあります。 その中の一つであるswitchを使えば即座にインストール済みformulaのバージョンを切り替えることができます! brew switch node 0.4.10 -- コメント:"switch"オプションは利用不可になった。(2021/06/20) --- [[openssl - Uncommon homebrew error: "Unknown command: switch" - Stack Overflow>https://stackoverflow.com/questions/66082776/uncommon-homebrew-error-unknown-command-switch]] - %%[[Homebrewでformulaを特定のバージョンに切り替える方法まとめ - Qiita>http://qiita.com/ysk24ok/items/91a7c502d33e0dde72ad]]%% brew switchコマンドは外部コマンドなのでhelpには載っていませんが、バージョン切り替えのためにリンクの張り替えをおこなってくれます。 ** tap [#h1e558ec] - [[brew tapとは - Qiita>https://qiita.com/saa/items/85ed5e914d424fbf9fd6]] brew tapとは公式以外のリポジトリをフォーミュラとしてHomebrewに追加するもので、brewのもとでinstall,uninstall,updateなどが行えます。 - [[brew tap で入れる Homebrew 外部コマンド - Qiita>https://qiita.com/tearoom6/items/1abf24ca6d872e6579b0]] Homebrew は外部コマンドを取り込むことができます。取り込んだ外部コマンドは、brew commandsを実行した時に"External commands"として表示されます。 ** 依存関係 [#faab3807] - [[Homebrew でパッケージの依存関係を調べる方法 - Qiita>https://qiita.com/shge/items/39e0e5cd83642c5d4add]] $ brew deps --installed --tree をつけると階層状に表示される。 * アンインストール [#vaa1edbe] - [[homebrewでインストールしたパッケージ全部削除する - Qiita>https://qiita.com/anon5r/items/d262c80b718739caf076]] brew uninstall --force $(brew list) - [[Homebrewアンインストール:白いきつねのスキル:So-netブログ>http://shiroi-kitsune-skill.blog.so-net.ne.jp/2012-08-29]] - [[Homebrewで古いバージョンのパッケージを削除するには - Meltdown Countdown rev.>http://marutanm.hatenablog.com/entry/20110712/p1]] brew cleanup [formula] - [[Homebrewがおかしくなったら再インストールしよう - Qiita>https://qiita.com/uhooi/items/91d2261ab30b6f2c143a]] -- コメント:/usr/local/var 辺りのディレクトリが残っていないか確認する。(2020/01/03) アンインストールしてからインストールするだけです。 * サービス [#b27bbf5e] - [[brew servicesを使ってHomebrewでインストールしたMySQLを自動起動する - cockscomblog?>http://cockscomb.hatenablog.com/entry/2014/04/05/153451]] いま自動起動の設定をしているもの一覧は brew services list - [[What is the meaning yellow service "started" status on Homebrew? - Stack Overflow>https://stackoverflow.com/questions/41873704/what-is-the-meaning-yellow-service-started-status-on-homebrew]] Unfortunately the yellow color means status unknown. Wonder why it says started though. * 関連 [#f81baaa9] #taglist(tag=Homebrew)