M1 pro - Homebrew 설치하기

🧐Luka.Kim.Dev·2022년 3월 17일
0
post-thumbnail

M1 Pro를 구입하고 몇가지 새로 설치 해야 하는 것들이 있었다.
그 중에 yarn 또는 npm 처럼 터미널에서 사용해야 하는 명령어가 있는데 이것을 사용하기 위해서는 Homebrew 부터 설치를 해야 했다.

이것은 Homebrew를 설치하고 yarn을 설치하는 과정에 대한 기록이다.

1. iTerm2 설치하기

우선 기본적으로 설치되어 있는 터미널보다는 가독성이 좋아서 사용하던 iTerm2를 크롬을 통해서 설치를 했다.

2. Homebrew 설치 유무 확인

$ which brew
/opt/homebrew/bin/brew (<--- 설치되어 있다면 경로가 표시)
brew not found (<--- 설치되어 있지 않다면 나타남)

만약 설치가 되어 있지만 새로 설치하고자 삭제를 원한다면 uninstall을 해주자.

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

3. Homebrew 설치

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

위와 같이 입력을 하면 sudo 패스워드 입력을 요구한다.

==> Checking for `sudo` access (which may request your password)...
Password:

중간에 엔터를 요구하기도 한다.

Press RETURN to continue or any other key to abort:
==> /usr/bin/sudo /bin/mkdir -p /opt/homebrew
==> /usr/bin/sudo /usr/sbin/chown root:wheel /opt/homebrew

설치가 완료 되면 다음과 같은 명령어를 입력을 요구한다.

==> 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 these two commands in your terminal to add Homebrew to your PATH:
    echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/{USER_NAME}/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"
- Run brew help to get started
- Further documentation:
    https://docs.brew.sh

두개의 명령어를 차례대로 입력해보자.

$ echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/luka_kim/.zprofile
$ eval "$(/opt/homebrew/bin/brew shellenv)"

4. 설치 재확인 및 버전 확인

$ which brew
/opt/homebrew/bin/brew
$ brew --version
Homebrew 3.4.2

5. brew 실행

$ brew
Example usage:
  brew search TEXT|/REGEX/
  brew info [FORMULA|CASK...]
  brew install FORMULA|CASK...
  brew update
  brew upgrade [FORMULA|CASK...]
  brew uninstall FORMULA|CASK...
  brew list [FORMULA|CASK...]

Fin

profile
코드가 내 마음을 읽어서 자동으로 작성되는 그날이 하루 빨리 오길..🧑🏻‍💻

0개의 댓글