0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

データエンジニア初心者日記(1)

Posted at

今日の勉強内容

今日はおうちで学べるデータベースのきほんを読みました。
4章まではデータベースやシステムそのものについての基礎知識的なものでしたが、
5章からMySQLのインストールがあるのですが、Macbookでインストールする際に使用するHomebrewの状態を綺麗にするのに手間取りました、、
今回はその対応の一部始終です。

インストールするために実施したこと

MacbookではHomebrewを使ってインストールするのですが、
昔インストールしたHomebrewのメンテナンスをしていなかったせいか権限がないなど色々なエラーが表示されたので、
brew doctorで状態を確認しました。

環境

macOS Sequoia 15.3.1
Homebrew 4.0.16→4.4.21

警告1:directories are not writable

うろ覚えですがこのようなメッセージが出たので、言われるがままその後に記載されていたsudoコマンドを
入力。

警告2:No Cask quarantine support available: unknown reason.

これはchatGPTに聞いてみました。
まず、Homebrewを最新版にしましょう、ということだったのでbrew updateを入力。
しかし権限がないことから、エラーと表示されたため、sudoコマンドで権限付与を実施。

defaults write com.apple.LaunchServices LSQuarantine -bool YES

その後、chatGPTから回答された下記のコマンドを入力し、macbookを再起動。

それでもまだ警告2が出てくるため、
brew cask doctor
と打ってみたところ、
brew cask is no longer a brew command. Use brew --cask instead.
と表示。

brew caskは現在のHomebrewにおいて独立したコマンドではないらしく、
brew reinstall brew-cask
でCask関連のパッケージを再インストール
それでもまだ出てくるので、そもそもbrew install --caskが正常動作していれば警告が出ていても
問題ないようで、
brew list --cask
でエラーが出てこないことを確認し、対応中止。

警告3:Some installed formulae are deprecated or disabled. You should find replacements for the following formulae: openssl@1.1

こちらのサイトを参考にさせていただいたところ、不要なのようなのでアンインストールを実施。
必要かわからないけど、
brew install openssl@3
でopenssl@3をインストールしてから、
brew uninstall openssl@1.1
で1.1をアンインストール。完了

警告4:You have unlinked kegs in your Cellar. Leaving kegs unlinked can lead to build-trouble and cause formulae that depend on those kegs to fail to run properly once built. Run brew link on these: gettext

こちらも上記のサイトを参考に、
brew link gettext
を入力。

警告5:You have an unnecessary local Core tap! This can cause problems installing up-to-date formulae. Please remove it by running: brew untap homebrew/core

tapが何かよくわからなかったのでこちらを読んでみました。

brew untap homebrew/core
と入力して完了

警告6:Your Homebrew's prefix is not /opt/homebrew.

Homebrew のインストールパス(prefix)が /opt/homebrew ではないため、一部のパッケージが正しく動作しない可能性があるとのこと。
brew --prefixの結果が/usr/localなので、/opt/homebrewにインストールし直す。

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

と入力したが
警告が色々と表示。
権限の関係で残骸が残っているようで、sudoコマンドを使ってそれらを削除。(内容はchatGPTに任せちゃいました、、)

ls -la /usr/local
を入力してtotal 0と返ってきたので削除が完了。
Homebrewを再インストール。(他の警告より先にこっちを先にやった方が良かったのでは。。?)

brew doctorを入力したら
Your system is ready to brew.と表示。

これでスタートライン、、
次回はMySQLのインストールを実施します。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?