首页前端开发其他前端知识Mac M1安装Homebrew的方法步骤

Mac M1安装Homebrew的方法步骤

时间2024-02-10 22:28:03发布访客分类其他前端知识浏览659
导读:收集整理的这篇文章主要介绍了Mac M1安装Homebrew的方法步骤,觉得挺不错的,现在分享给大家,也给大家做个参考。 最常用命令搜索软件: brew seArch 软件包名称安装软件...
收集整理的这篇文章主要介绍了Mac M1安装Homebrew的方法步骤,觉得挺不错的,现在分享给大家,也给大家做个参考。

最常用命令

搜索软件: brew seArch 软件包名称

安装软件: brew install 软件包名称

卸载软件: brew uninstall 软件包名称

错误解决

问题1 : curl: (7) Failed to connect to http://raw.gIThubusercontent.COM port 443: Connection refused” 错误

解决方法:

打开 www.ipaddress.com 网站查询 raw.githubusercontent.com 主机的真实ip

打开 /etc/hosts 文件,增加一条记录

185.199.108.133  raw.githubusercontent.com 

问题2 :如果 brew install 出以下错误, 则安装时使用 arch -arm64 brew install 软件包名 进行安装

创建安装目录

Homebrew 安装脚本会将程序默认装至 /usr/local/Homebrew ,这是 Intel 芯片架构上的安装路径,M1芯片上则需要安装到 /opt/Homebrew/ 下。

sudo mkdir -p /opt/homebrewsudo chown -R $(whoami) /opt/homebrew

下载 homebrew 包并解压至 /opt/homebrew 目录

curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew

如果下载慢,可以直接通过 https://github.com/Homebrew/brew/tarball/master 或本地下载,copy 到 /opt 目录下再将压缩包解压到 /opt/homebrew 目录

cp /opttar xz 压缩包名 --strip 1 -C homebrew

将路径增加到PATH环境变量中

vim ~/.bash_PRofile
#在 .bash_profile 中新增export PATH=$PATH:/opt/homebrew/bin;
    #保存退出
#刷新生效source ~/.bash_profile

修改源

cd "$(brew --repo)"git clone https://mirrors.ustc.edu.cn/brew.git  cd "$(brew --repo)/Library/Taps/homebrew" git clone https://mirrors.ustc.edu.cn/homebrew-core.git git clone https://mirrors.ustc.edu.cn/homebrew-cask.git brew update #更新

其它镜像地址:

HomeBrew 官方镜像:
brew: https://github.com/Homebrew/brew
core: https://github.com/Homebrew/homebrew-core
cask: https://github.com/Homebrew/homebrew-cask

清华大学镜像:
brew: https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
core: https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
cask: https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git

中科大镜像:
brew: https://mirrors.ustc.edu.cn/brew.git
core: https://mirrors.ustc.edu.cn/homebrew-core.git
cask: https://mirrors.ustc.edu.cn/homebrew-cask.git

终于可以进行下载软件了

brew install -s 软件包名

到此这篇关于Mac M1安装Homebrew的方法步骤的文章就介绍到这了,更多相关M1安装Homebrew内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!

@H_126_106@您可能感兴趣的文章:
  • Mac M1安装mnmp(Mac+Nginx+MySQL+PHP)开发环境
  • @L_406_4@
  • 本地Docker安装Postgres 12 + pgadmin的方法 (支持Apple M1)
  • 2020Mac M1安装jdk和IDEA的详细方法
  • M1芯片安装mysql8.0数据库的实现步骤(图文)
  • M1芯片安装python3.9.1的实现

声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!


若转载请注明出处: Mac M1安装Homebrew的方法步骤
本文地址: https://pptw.com/jishu/608959.html
推荐四款可视化工具(解决99%的可视化大屏需求) VS Code使用Git可视化管理源代码详细教程(推荐)

游客 回复需填写必要信息