====== HomeBrew ====== * https://brew.sh * [[https://docs.brew.sh/Manpage|brew(1) – The Missing Package Manager for macOS (or Linux) — Homebrew Documentation]] * [[homebrew:formula|Homebrew formula]] * [[https://github.com/Homebrew/homebrew-autoupdate|homebrew-autoupdate]] ===== Linux ===== * https://github.com/Homebrew/linuxbrew-core * [[https://docs.brew.sh/Homebrew-on-Linux|Homebrew-on-Linux]] * [[https://formulae.brew.sh/formula-linux/|LinuxBrew Package List]] * [[http://brew.sh/|Homebrew]]의 Linux 버전. 기본 패키지 관리자에 없는 애플리케이션들을 많이 설치할 수 있다. * root 권한없이, 개인 계정에 애플리케이션 설치. ===== Install on Linux ===== sudo apt install build-essential git curl * 프롬프트와 설명이 출력됨. /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" * 프롬프트 없이 바로 실행하기 echo | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" ===== brew PATH 후순위로 만들기 / MANPATH 덮어 쓰는 문제 해소===== * [[https://unix.stackexchange.com/questions/537062/homebrew-replaced-python3-how-to-reverse|linux - Homebrew replaced Python3, how to reverse? - Unix & Linux Stack Exchange]] * https://github.com/Homebrew/brew/blob/master/Library/Homebrew/cmd/shellenv.sh * ''brew shellenv'' 결과를 출력해서 PATH 순서를 바꿔서 넣거나, * 아니면 ''eval("brew shellenv...")'' 하기 전에, ''OLD_PATH=$PATH'' 를 저장해두고, ''PATH''값을 비워버리고, eval하고, 그 뒤에 다시 ''PATH=$OLD_PATH:$PATH'' 형태로 변경하거나.. * ''MANPATH'' 환경변수가 존재하지 않을 경우 기본으로 ''/etc/manpath.config'' 를 자동으로 따라야한다. * 하지만, ''brew'' 환경 변수 설정시 ''MANPATH''가 없으면 ''brew'' 전용 경로로 덮어 써 버려서 먼저 ''MANPATH'' 환경변수 설정이 필요하다. * ''%%manpath --quiet%%'' 명령으로 ''/etc/manpath.config'' 의 설정을 환경변수로 뽑아낼 수 있다. export MANPATH=$(manpath --quiet) OLDPATH=$PATH eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) export PATH=$OLDPATH:${HOMEBREW_PREFIX}/bin:${HOMEBREW_PREFIX}/sbin # .... ===== uninstall/remove homebew on Linux ===== /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)" sudo rm -rf /home/linuxbrew # 본인 계정의 ~/.bashrc 에 등록된 homebrew 관련 스크립트 제거 ===== clean up ===== * brew 패키지 설치는 상당한 용량을 차지한다. 주기적으로 캐시 등의 삭제가 필요하다. # 더이상 불필요해진 의존성 삭제 brew autoremove # 캐시 전체 삭제 brew cleanup --prune=all ===== tap ===== * [[https://docs.brew.sh/Taps|Taps (Third-Party Repositories) — Homebrew Documentation]] * 제 3의 개인별 리포지토리 구성방식. * 아래 오류 발생시 해당 탭의 설정에 문제가 있는 것임. ''untap'' 하고 제거하고 다른 애플리케이션을 설치하던가 한다. Warning: Calling bottle :unneeded is deprecated! There is no replacement. Please report this issue to the 4d63/tldr tap (not Homebrew/brew or Homebrew/core): /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/4d63/homebrew-tldr/Formula/tldr.rb:6 brew remove tldr brew untap 4d63/tldr ===== linux fonts ===== * https://github.com/Homebrew/homebrew-linux-fonts brew tap linuxbrew/fonts # 한번만 # font 설치 # font 디렉토리 연결 : 한번만 ln -s /home/linuxbrew/.linuxbrew/share/fonts ~/.local/share/fonts # font 갱신 fc-cache -fv ===== bundle ===== * ''Brewfile''로 일괄 설치/삭제 등을 할 수 있다. * ''brew bundle dump'' : 현재 디렉토리에 ''Brewfile''을 생성하고 현재 이미 설치된 모든 항목을 덤프한다. * ''brew bundle'' : 현재 디렉토리의 ''Brewfile''을 찾아서 설치한다. * ''brew bundle %%--%%file=/path/to/Brewfile'' : 특정 Brewfile 을 지정해서 설치한다. * ''%%--no-lock%%'' : ''Brewfile.lock.json'' 생성을 막아준다. ===== 유사 패키지 관리자 ===== * [[hubapp|hubapp]] ===== 참조 ===== * [[https://www.tecmint.com/linuxbrew-package-manager-for-linux/|Linuxbrew - The Homebrew Package Manager for Linux]]