brew安装:

  1. /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

homebrew 报权限错误”Permission denied”问题

原文:https://blog.90.vc/archives/512

  1. ==> Fetching /usr/local/Homebrew...
  2. error: cannot open .git/FETCH_HEAD: Permission denied
  3. error: Unable to create '/usr/local/Homebrew/.git/refs/remotes/origin/HEAD.lock': Permission denied
  4. error: Could not setup refs/remotes/origin/HEAD
  5. ==> Resetting /usr/local/Homebrew...
  6. fatal: Unable to create '/usr/local/Homebrew/.git/index.lock': Permission denied
  7. ==> Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...
  8. error: cannot open .git/FETCH_HEAD: Permission denied
  9. error: Unable to create '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/.git/refs/remotes/origin/HEAD.lock': Permission denied
  10. error: Could not setup refs/remotes/origin/HEAD
  11. ==> Resetting /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...
  12. fatal: Unable to create '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/.git/index.lock': Permission denied
  • 解决方式
    1. sudo chown -R $(whoami) $(brew --prefix)/*

    Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-services /usr/local/

    原文:https://blog.csdn.net/FindStar_ing/article/details/107383669
    1. chenjingwendeMacBook-Pro:~ chenjingwen$ brew services start nginx
    2. ==> Tapping homebrew/services
    3. Cloning into ‘/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services’…
    4. fatal: unable to access https://github.com/Homebrew/homebrew-services/’: Failed to connect to 127.0.0.1 port 1080: Connection refused
    5. Error: Failure while executing; git clone https://github.com/Homebrew/homebrew-services /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services exited with 128.
    6. Error: Failure while executing; /usr/local/bin/brew tap homebrew/services exited with 1.
    7. chenjingwendeMacBook-Pro:~ chenjingwen$ git config --global --unset http.proxy
    8. chenjingwendeMacBook-Pro:~ chenjingwen$ git config --global --unset https.proxy
    9. chenjingwendeMacBook-Pro:~ chenjingwen$ brew services start nginx
    10. ==> Tapping homebrew/services
    11. Cloning into ‘/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services’…
    12. remote: Enumerating objects: 52, done.
    13. remote: Counting objects: 100% (52/52), done.
    14. remote: Compressing objects: 100% (48/48), done.
    15. remote: Total 829 (delta 20), reused 16 (delta 3), pack-reused 777
    16. Receiving objects: 100% (829/829), 232.61 KiB | 3.00 KiB/s, done.
    17. Resolving deltas: 100% (338/338), done.
    18. Tapped 1 command (39 files, 310.3KB).
    19. ==> Successfully started nginx (label: homebrew.mxcl.nginx)
    解决方案:
  1. git config --global --unset http.proxy
  2. git config --global --unset https.proxy
  1. git clone git://mirrors.ustc.edu.cn/homebrew-cask.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask --depth=1
  1. git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1

Mac homebrew报错Error: homebrew-core is a shallow clone.

原文:https://blog.csdn.net/weixin_35757704/article/details/112133562

解决方法

删除homebrew-core后更新即可

  1. cd /usr/local/Homebrew/Library/Taps/homebrew
  2. rm -rf homebrew-core
  3. brew upgrade


使用brew upgrade后会重新更新homebrew-core

mac无法验证此app不包含恶意软件

禁用Gatekeeper

  1. sudo spctl --master-disable

redis安装:

brew 安装

  1. brew install redis

启动:

  1. To start redis:
  2. brew services start redis
  3. Or, if you don't want/need a background service you can just run:
  4. /usr/local/opt/redis/bin/redis-server /usr/local/etc/redis.conf
  5. ==> Summary
  6. 🍺 /usr/local/Cellar/redis/6.2.5: 14 files, 2.0MB