최근 brew update 진행 중 아래와 같은 오류가 발생하였다.
아마도 최근 OS초기화 후 Git을 설치하는 과정에서 설정이 충돌이 하였거나, PATH 환경 변수가 변경되면서 Homebrew에서 설치한 프로그램을 찾지 못하는 경우가 아닌가 생각된다.
==> Updating Homebrew...
fatal: couldn't find remote ref refs/heads/master
Error: Fetching /opt/homebrew failed!
Error: Some taps failed to update!
The following taps can not read their remote branches:
This is happening because the remote branch was renamed or deleted.
Reset taps to point to the correct remote branches by running `brew tap --repair`
brew doctor 를 실행하여 정확한 원인과 해결 방법을 확인해보자.
brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: Suspicious https://github.com/Homebrew/brew git origin remote found.
The current git origin is:
https://github.com/cussip/grep.git
With a non-standard origin, Homebrew won't update properly.
You can solve this by setting the origin remote:
git -C "/opt/homebrew" remote set-url origin https://github.com/Homebrew/brew
Warning: Some installed casks are deprecated or disabled.
You should find replacements for the following casks:
cocoapods
Warning: Homebrew's "sbin" was not found in your PATH but you have installed
formulae that put executables in /opt/homebrew/sbin.
Consider setting your PATH for example like so:
echo 'export PATH="/opt/homebrew/sbin:$PATH"' >> ~/.zshrc
brew doctor 에서는 위와 같은 메시지가 출력되었다.
총 3가지 해결 방법이 출력되었고,
그중에 현재 내가 겪는 문제는 'cocoapods'의 사용여부와는 무관한 것으로 생각되기 때문에 2번을 제외한 2가지 방법만 실행하였다.
1) 비표준 원격 저장소 수정
git -C "/opt/homebrew" remote set-url origin https://github.com/Homebrew/brew
2) 사용되지 않는 cask 제거(선택)
brew uninstall cocoapods
3) PATH 환경 변수 설정
echo 'export PATH="/opt/homebrew/sbin:$PATH"' >> ~/.zshrc
실행 후 brew update 가 다시 정상적으로 작동하는 것을 확인하였다.
(이후, Git 설정을 일부 수정하는 작업을 진행하였다. 동일한 증상인 경우 git push 테스트를 해보는 것을 권장한다.)
'macOS' 카테고리의 다른 글
[macOS] 한/영 전환 단축키 변경 / CapsLock 키 설정 변경 (0) | 2024.09.01 |
---|