小白求助 Homebrew 的问题,重装系统也没解决

303 天前
 sylarc

brew 升级软件时总是出错,试了很多方法,前些天全新安装了 macOS15.1.1,还是没有解决,麻烦大家看看:

==> Upgrading calibre ==> Downloading https://download.calibre-ebook.com/7.22.0/calibre-7.22.0.dmg ###################################################################################################### 100.0% ==> Backing App 'calibre.app' up to '/usr/local/Caskroom/calibre/7.21.0/calibre.app' ==> Removing App '/Applications/calibre.app' ==> Unlinking Binary '/usr/local/bin/calibre' ==> Unlinking Binary '/usr/local/bin/calibre-complete' ==> Unlinking Binary '/usr/local/bin/calibre-customize' ==> Unlinking Binary '/usr/local/bin/calibre-debug' ==> Unlinking Binary '/usr/local/bin/calibre-parallel' ==> Unlinking Binary '/usr/local/bin/calibre-server' ==> Unlinking Binary '/usr/local/bin/calibre-smtp' ==> Unlinking Binary '/usr/local/bin/calibredb' ==> Unlinking Binary '/usr/local/bin/ebook-convert' ==> Unlinking Binary '/usr/local/bin/ebook-device' ==> Unlinking Binary '/usr/local/bin/ebook-polish' ==> Unlinking Binary '/usr/local/bin/ebook-viewer' ==> Unlinking Binary '/usr/local/bin/fetch-ebook-metadata' ==> Unlinking Binary '/usr/local/bin/lrf2lrs' ==> Unlinking Binary '/usr/local/bin/lrfviewer' ==> Unlinking Binary '/usr/local/bin/lrs2lrf' ==> Unlinking Binary '/usr/local/bin/markdown-calibre' ==> Unlinking Binary '/usr/local/bin/web2disk' ==> Unlinking Binary '/usr/local/bin/ebook-edit' ==> Unlinking Binary '/usr/local/bin/ebook-meta' ==> Moving App 'calibre.app' to '/Applications/calibre.app'

/Library/Developer/CommandLineTools/usr/include/swift/module.modulemap:13:8: error: redefinition of module 'SwiftBridging' 11 | //===----------------------------------------------------------------------===// 12 | 13 | module SwiftBridging { | `- error: redefinition of module 'SwiftBridging' 14 | header "bridging" 15 |

/Library/Developer/CommandLineTools/usr/include/swift/bridging.modulemap:13:8: note: previously defined here 11 | //===----------------------------------------------------------------------===// 12 | 13 | module SwiftBridging { | `- note: previously defined here 14 | header "bridging" 15 |

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Modules/Foundation.swiftmodule/x86_64-apple-macos.swiftinterface:5:8: error: failed to build module 'CoreFoundation'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 6.0 effective-5.10 (swiftlang-6.0.0.7.43 clang-1600.0.25.3)', while this compiler is 'Apple Swift version 6.0.2 effective-5.10 (swiftlang-6.0.2.1.2 clang-1600.0.26.4)'). Please select a toolchain which matches the SDK. 3 | // swift-module-flags: -target x86_64-apple-macos15.1 -target-variant x86_64-apple-ios18.1-macabi -enable-objc-interop -autolink-force-load -enable-library-evolution -module-link-name swiftFoundation -swift-version 5 -enforce-exclusivity=unchecked -O -library-level api -enable-upcoming-feature InferSendableFromCaptures -enable-bare-slash-regex -user-module-version 3107 -module-name Foundation -package-name ""FoundationPreview"" 4 | import Combine 5 | import CoreFoundation | `- error: failed to build module 'CoreFoundation'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 6.0 effective-5.10 (swiftlang-6.0.0.7.43 clang-1600.0.25.3)', while this compiler is 'Apple Swift version 6.0.2 effective-5.10 (swiftlang-6.0.2.1.2 clang-1600.0.26.4)'). Please select a toolchain which matches the SDK. 6 | import Darwin 7 | import Dispatch

/Library/Developer/CommandLineTools/usr/include/swift/module.modulemap: 0: /Library/Developer/CommandLineTools/usr/include/swift/bridging.modulemap: 0: /usr/local/Homebrew/Library/Homebrew/cask/utils/copy-xattrs.swift:3:8: error: failed to build module 'Foundation'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 6.0 effective-5.10 (swiftlang-6.0.0.7.43 clang-1600.0.25.3)', while this compiler is 'Apple Swift version 6.0.2 effective-5.10 (swiftlang-6.0.2.1.2 clang-1600.0.26.4)'). Please select a toolchain which matches the SDK. 1 | #!/usr/bin/swift 2 | 3 | import Foundation | `- error: failed to build module 'Foundation'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 6.0 effective-5.10 (swiftlang-6.0.0.7.43 clang-1600.0.25.3)', while this compiler is 'Apple Swift version 6.0.2 effective-5.10 (swiftlang-6.0.2.1.2 clang-1600.0.26.4)'). Please select a toolchain which matches the SDK. 4 | 5 | struct SwiftErr: TextOutputStream { ==> Purging files for version 7.22.0 of Cask calibre ==> Purging files for version 7.22.0 of Cask calibre Warning: Reverting upgrade for Cask calibre ==> Purging files for version 7.21.0 of Cask calibre

Error: Problems with multiple casks: calibre: It seems there is already an App at '/Applications/calibre.app'.

现在用 brew install xxxx --adopt 方法代替升级

重装 brew ,重装 CommandLineTools, 最后全新安装了系统,没用时间机器恢复数据,还是没有解决

安装 brew 是用国内的:/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

4541 次点击
所在节点    macOS
37 条回复
Granthese
303 天前
黑苹果?
sylarc
302 天前
@nieyujiang #19 虽然我不太明白,我的可能不是这个情况吧,新系统也这样
sylarc
302 天前
@Nosub #20 不太明白,我觉得国内镜象最多慢点,不全,应该和官方是一致的吧
sylarc
302 天前
@Granthese 黑苹果,翻贴子看,可能与 oclp 有关系,有时间我卸载试试
littlewing
295 天前
Macmini M4 最新系统,一样的情况
sylarc
294 天前
@littlewing 看来不是我能解决的了。之前用--adopt 的方式安装代替升级,后来也出错。把 cmt 删除了,竟然能升级了,你可以试试。我用 cask upgrade 批量升级的
YzhucaiguaiY
292 天前
相同的问题,我是 macos 15.1.1
先手动卸载了 CommandLineTools
sudo rm -rf /Library/Developer/CommandLineTools/
然后重新安装,但是是手动下载新版本包安装的
https://download.developer.apple.com/Developer_Tools/Command_Line_Tools_for_Xcode_16.2/Command_Line_Tools_for_Xcode_16.2.dmg
sylarc
291 天前
@YzhucaiguaiY 我这样试过,出现新错误。后来删除 cmt ,正常一次,后来又出错。
今天更新的 15.2 更新了两个软件没出错,还要再观察。
autumn426
291 天前
autumn426
291 天前
可以了 M1pro macos15.1.1Homebrew 4.4.11
sylarc
290 天前
不是完全确认,我的错误原因大概是 OpenCore-Patcher 破坏了系统 sip 造成的,等下次系统升级再确认,这次不小心又打上了补丁,重启前的升级是正常的
sylarc
288 天前
唉,最新情况,系统 15.2 ,有 opencore-pather

brew install xxxx --adopt 出错:listxattr for destination failed: 2

brew cu -a -y -f 正常运行

懵了,与上次出错之间,没再折腾
littlewing
277 天前
我已经放弃了,Macmini M4 15.2 intel MacBook Pro 15.2 都是一样的问题,不用 brew cask 了
sylarc
277 天前
@littlewing #33 在用 brew install xxxx --adopt 升级
sylarc
265 天前
更新一下:
最近系统没升级,15.2 ,偶尔 brew update
今天 brew install xxxx --adopt 失败
brew cu -a 成功
但愿是 brew 自己修复这个问题

brew doctor 依然 :
Warning: No Cask quarantine support available: unknown reason.
在 github 上这个好像也没有讨论出结果
sylarc
260 天前
体验到的 warp 的 ai 功能:
upgrade 又一次升级失败,warp 提示 brew install xxx --adpot
sylarc
234 天前
最近安装了 15.3,不打 oclp 补丁,brew 正常了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://ex.noerr.eu.org/t/1094002

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX