M1 Macbook安装Qt

M1 Macbook安装Qt

M1 Macbook(Monterey 12.2.1) 安装Qt遇到的问题记录

首先执行:

brew install qt

没有意外报错了,错误信息如下:

Running `brew update --preinstall`...
fatal: Could not resolve HEAD to a revision
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
==> New Casks
keysafe                    mixed-in-key-live          wpsoffice-cn
==> Updated Casks
Updated 40 casks.

Warning: No available formula with the name "qt".
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.

那我就更新一下brew吧,执行:

brew update --preinstall

又是报错:

fatal: Could not resolve HEAD to a revision

应该是brew出问题了,再次用这个命令更新一下:

brew update --verbose

孩她妈报错:

Checking if we need to fetch /opt/homebrew...
Checking if we need to fetch /opt/homebrew/Library/Taps/homebrew/homebrew-cask...
Fetching /opt/homebrew...
Checking if we need to fetch /opt/homebrew/Library/Taps/homebrew/homebrew-core...
Fetching /opt/homebrew/Library/Taps/homebrew/homebrew-core...
Updating /opt/homebrew...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Switched to and reset branch 'master'
Your branch is up to date with 'origin/master'.
Switched to and reset branch 'stable'
Current branch stable is up to date.

Updating /opt/homebrew/Library/Taps/homebrew/homebrew-core...
fatal: Could not resolve HEAD to a revision

Already up-to-date.

但至少信息详细了点,注意看Updating /opt/homebrew/Library/Taps/homebrew/homebrew-core...,于是我们,进入这个目录,执行下面的命令

cd /opt/homebrew/Library/Taps/homebrew/homebrew-core
git fetch --prune origin
git pull --rebase origin master

命令都执行完后,在更新brew就易如反掌了,最后顺利安装Qt

brew update
brew install qt
  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值