[MacOS] Homebrew 설치 및 준비

seony·2022년 7월 6일
0

아래의 homebrew 설치는 인텔칩 MacBook Pro에서 설치한 내용을 바탕으로 기록한다.

1. What is homebrew?

homebrew는 macOS나 Linux에서 패키지를 편리하게 설치할 수 있도록 제공하는 패키지이다.

2. How to install homebrew

2-1. howbrew 버전 확인

먼저 자신의 macOS에 homebrew가 설치되어 있는지 확인한다. 만약 설치되어 있지 않다면 아래와 같이 **command not found**라는 결과를 확인할 수 있을 것이다.
% brew -v
zsh: command not found: brew

자신의 macOS에 설치되어 있다면 설치된 homebrew의 version을 확인할 수 있다.

% brew -v
Homebrew 3.5.4
Homebrew/homebrew-core (git revision b765c617d32; last commit 2022-07-06)

2-2. 설치

homebrew를 설치하기 위해 [homebrew 페이지](https://brew.sh/index_ko)를 방문한다.

homebrew에 있는 아래의 명령어를 복사하여 terminal에 입력한다.

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

2-3. 설치 중 오류 발생

설치 중 아래와 같은 오류가 발생했다.
error: Not a valid ref: refs/remotes/origin/master
fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree.

homebrew community에서 검색을 동일한 오류를 찾았고, 아래와 같이 터미널에 입력하였다.

% brew tap homebrew/core
==> Homebrew has enabled anonymous aggregate formula and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics
No analytics have been recorded yet (nor will be during this `brew` run).

Running `brew update --auto-update`...
==> 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: 1224134, done.
remote: Counting objects: 100% (202/202), done.
remote: Compressing objects: 100% (96/96), done.
remote: Total 1224134 (delta 114), reused 192 (delta 106), pack-reused 1223932
Receiving objects: 100% (1224134/1224134), 495.09 MiB | 777.00 KiB/s, done.
Resolving deltas: 100% (844377/844377), done.
Updating files: 100% (6500/6500), done.
Tapped 3 commands and 6169 formulae (6,511 files, 542.6MB).

2-4. 설치 완료

위에서 발생한 오류를 해결 후 다시 설치했다. 아래와 같은 화면이 결과가 보이면 설치 완료이다.
% /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

==> Checking for `sudo` access (which may request your password)...
Password:
==> 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

Press RETURN/ENTER to continue or any other key to abort:
==> /usr/bin/sudo /usr/sbin/chown -R seony:admin /usr/local/Homebrew
==> Downloading and installing Homebrew...
Updating files: 100% (2799/2799), done.
HEAD is now at 976681134 Merge pull request #13517 from Rylan12/fix-on-macos-version-on-linux
==> 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 (nor will any 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

homebrew 사용 전 준비 작업

homebrew를 사용하기 전에 Application 설치를 CLI( Command line interface )에서 편리하게 가능하도록 지원하는 Cask 패키지를 설치한다.
% brew install cask
Running `brew update --auto-update`...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).

... 중간 생략 ...

==> Installing cask
==> Pouring cask--0.8.8.all.bottle.tar.gz
==> Caveats
Emacs Lisp files have been installed to:
  /usr/local/share/emacs/site-lisp/cask
==> Summary
🍺  /usr/local/Cellar/cask/0.8.8: 13 files, 152KB
==> Running `brew cleanup cask`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Caveats
==> cask
Emacs Lisp files have been installed to:
  /usr/local/share/emacs/site-lisp/cask
 % brew list        
==> Formulae
bdw-gc		emacs		guile		libidn2		libunistring	p11-kit
ca-certificates	gettext		jansson		libnghttp2	m4		pkg-config
cask		gmp		libevent	libtasn1	nettle		readline
coreutils	gnutls		libffi		libtool		openssl@1.1	unbound
profile
Developer

0개의 댓글

관련 채용 정보