0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

パッケージマネージャーHomebrewの基礎(自分用メモ)

0
Posted at

Homebrewとは

パッケージを管理してくれるソフト。パッケージのインストールや、必要な他パッケージのインストールなども実行してくれる。
パッケージには依存関係があり、手動で管理するのがめっちゃ大変なので、すべてのエンジニアはこのようなソフトを使用する。

Homebrewを最新に保つ

1, Homebrewの更新

brew update

2, インストール済みパッケージの更新

brew upgrade

3, 古いパッケージのクリーンアップ

brew cleanup

全部同時にやりたいあなたへ

brew update && brew upgrade && brew cleanup

ついでに自動化したいあなたへ

下記スクリプトファイルを作成。

update_homebrew.sh
#!/bin/bash
brew update
brew upgrade
brew cleanup

実行権限を付与。

chmod +x update_homebrew.sh

crontabファイルに実行周期と実行対象ファイルを設定する。

# crontabを開く
crontab -e
# 実行周期と実行対象ファイルのフルパスを追記。
# 例えば、下記は12月31日の23:59にこのスクリプトを定期実行するよう指定している。
# もちろん一年に一回しか使わないようなファイルではないので、周期の設定は調整してね。
59 23 31 12 * [update_homebrew.shのフルパス]
0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?