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

50 天前
 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)"

2387 次点击
所在节点    macOS
36 条回复
Ipsum
50 天前
先把这个软件删了呢?
sylarc
50 天前
@Ipsum 重装了系统,软件都是重新安装的,目前看 edge 不出错
sylarc
50 天前
@Ipsum 重装系统前试过删除再安装,一样还是不能升级
donaldturinglee
50 天前
很可能是 brew 出的问题,不过 Mac 我一般都是手动安装或者安装包安装的
Dislocator
50 天前
挂梯子,用国外的 brew
hefish
50 天前
挂梯子,用国外的 brew +1
sitdownkevin
50 天前
https://github.com/orgs/Homebrew/discussions/5723

手动安装 16.1 的 CLT 能解决
sylarc
50 天前
@sitdownkevin 感谢,貌似对症,我试一下
sylarc
50 天前
@donaldturinglee 更新强迫症,又想偷懒,brew 可以快速升级不费力
sylarc
50 天前
@Dislocator @hefish 换源试过,无效
sylarc
50 天前
按 @sitdownkevin 指引,错误缩小了,还是 clt 有问题

Error: Failure while executing; `/usr/bin/env /Library/Developer/CommandLineTools/usr/bin/swift -target x86_64-apple-macosx15 /usr/local/Homebrew/Library/Homebrew/cask/utils/copy-xattrs.swift /usr/local/Caskroom/opera/115.0.5322.68/Opera.app /Applications/Opera.app` exited with 1. Here's the output:
listxattr for destination failed: 2
donaldturinglee
50 天前
手动降依赖不是很安全的,你到时候能正常用了,但是有些软件又开不了了,属于拆了东墙补西墙
dilidilid
50 天前
装不上就不用 brew 装呗,这玩意儿也是人维护的,没道理完全不出错
Nosub
50 天前
macOS 安装 Homebrew ,希望对你有帮助。

https://nosub.net/posts/p/227
nieyujiang
50 天前
执行一下 file /usr/bin/xattr 这个命令,看下返回是不是下面这个输出.
/usr/bin/xattr: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e]
/usr/bin/xattr (for architecture x86_64): Mach-O 64-bit executable x86_64
/usr/bin/xattr (for architecture arm64e): Mach-O 64-bit executable arm64e
sylarc
50 天前
@nieyujiang 是的,一模一样,求批明方向
sylarc
50 天前
@Nosub 我把更新源切换到 github 过,除了变慢了,没有变化
PhDLuffy
50 天前
路由挂梯子,mac 用全局模式或增强模式,从来没出过错。
nieyujiang
50 天前
@sylarc 一样就不清楚了,之前有遇到过 xattr 命令被某个同名 python 包替换导致功能失效的问题,目前看不是这个问题
Nosub
50 天前
@sylarc 你没看懂吗,可以离线安装,github 只是 download 安装包,我就是这样安装的。

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

https://www.v2ex.com/t/1094002

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

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

© 2021 V2EX