V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
sylarc
V2EX  ›  macOS

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

  •  
  •   sylarc · 29 天前 · 2133 次点击

    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)"

    第 1 条附言  ·  28 天前

    按照 7 楼 @sitdownkevin 的提示,更新clt 到了 16.1 ,再更新软件出现新情况:

    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/double-commander/1.1.21/Double\ Commander.app /Applications/Double\ Commander.app exited with 1. Here's the output: listxattr for destination failed: 2

    补充一下新

    brew doctor

    Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry or file an issue; just ignore this. Thanks!

    Warning: Some installed casks are deprecated or disabled. You should find replacements for the following casks: cakebrew

    Warning: No Cask quarantine support available: unknown reason.

    brew config

    HOMEBREW_VERSION: 4.4.8 ORIGIN: https://github.com/Homebrew/brew HEAD: e78a0adb4f260913fffdc956cc8c20fb54109feb Last commit: 5 days ago Branch: stable Core tap JSON: 01 Dec 02:08 UTC Core cask tap JSON: 01 Dec 02:08 UTC HOMEBREW_PREFIX: /usr/local HOMEBREW_API_DOMAIN: https://mirrors.aliyun.com/homebrew/homebrew-bottles/api HOMEBREW_BOTTLE_DOMAIN: https://mirrors.aliyun.com/homebrew/homebrew-bottles HOMEBREW_CASK_OPTS: [] HOMEBREW_MAKE_JOBS: 8 HOMEBREW_PIP_INDEX_URL: http://mirrors.aliyun.com/pypi/simple Homebrew Ruby: 3.3.6 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/bin/ruby CPU: octa-core 64-bit cometlake Clang: 16.0.0 build 1600 Git: 2.39.5 => /Library/Developer/CommandLineTools/usr/bin/git Curl: 8.7.1 => /usr/bin/curl macOS: 15.1.1-x86_64 CLT: 16.1.0.0.1.1729049160 Xcode: N/A

    34 条回复    2024-12-27 11:34:07 +08:00
    Ipsum
        1
    Ipsum  
       29 天前
    先把这个软件删了呢?
    sylarc
        2
    sylarc  
    OP
       29 天前
    @Ipsum 重装了系统,软件都是重新安装的,目前看 edge 不出错
    sylarc
        3
    sylarc  
    OP
       29 天前
    @Ipsum 重装系统前试过删除再安装,一样还是不能升级
    donaldturinglee
        4
    donaldturinglee  
       29 天前 via Android
    很可能是 brew 出的问题,不过 Mac 我一般都是手动安装或者安装包安装的
    Dislocator
        5
    Dislocator  
       29 天前
    挂梯子,用国外的 brew
    hefish
        6
    hefish  
       29 天前
    挂梯子,用国外的 brew +1
    sitdownkevin
        7
    sitdownkevin  
       29 天前
    https://github.com/orgs/Homebrew/discussions/5723

    手动安装 16.1 的 CLT 能解决
    sylarc
        8
    sylarc  
    OP
       29 天前
    @sitdownkevin 感谢,貌似对症,我试一下
    sylarc
        9
    sylarc  
    OP
       29 天前
    @donaldturinglee 更新强迫症,又想偷懒,brew 可以快速升级不费力
    sylarc
        10
    sylarc  
    OP
       29 天前
    @Dislocator @hefish 换源试过,无效
    sylarc
        11
    sylarc  
    OP
       29 天前
    按 @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
        12
    donaldturinglee  
       29 天前 via Android
    手动降依赖不是很安全的,你到时候能正常用了,但是有些软件又开不了了,属于拆了东墙补西墙
    dilidilid
        13
    dilidilid  
       28 天前
    装不上就不用 brew 装呗,这玩意儿也是人维护的,没道理完全不出错
    Nosub
        14
    Nosub  
       28 天前 via iPhone
    macOS 安装 Homebrew ,希望对你有帮助。

    https://nosub.net/posts/p/227
    nieyujiang
        15
    nieyujiang  
       28 天前
    执行一下 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
        16
    sylarc  
    OP
       28 天前
    @nieyujiang 是的,一模一样,求批明方向
    sylarc
        17
    sylarc  
    OP
       28 天前
    @Nosub 我把更新源切换到 github 过,除了变慢了,没有变化
    PhDLuffy
        18
    PhDLuffy  
       28 天前
    路由挂梯子,mac 用全局模式或增强模式,从来没出过错。
    nieyujiang
        19
    nieyujiang  
       28 天前 via iPhone
    @sylarc 一样就不清楚了,之前有遇到过 xattr 命令被某个同名 python 包替换导致功能失效的问题,目前看不是这个问题
    Nosub
        20
    Nosub  
       28 天前 via iPhone
    @sylarc 你没看懂吗,可以离线安装,github 只是 download 安装包,我就是这样安装的。
    Granthese
        21
    Granthese  
       28 天前
    黑苹果?
    sylarc
        22
    sylarc  
    OP
       27 天前
    @nieyujiang #19 虽然我不太明白,我的可能不是这个情况吧,新系统也这样
    sylarc
        23
    sylarc  
    OP
       27 天前
    @Nosub #20 不太明白,我觉得国内镜象最多慢点,不全,应该和官方是一致的吧
    sylarc
        24
    sylarc  
    OP
       27 天前
    @Granthese 黑苹果,翻贴子看,可能与 oclp 有关系,有时间我卸载试试
    littlewing
        25
    littlewing  
       20 天前
    Macmini M4 最新系统,一样的情况
    sylarc
        26
    sylarc  
    OP
       19 天前
    @littlewing 看来不是我能解决的了。之前用--adopt 的方式安装代替升级,后来也出错。把 cmt 删除了,竟然能升级了,你可以试试。我用 cask upgrade 批量升级的
    YzhucaiguaiY
        27
    YzhucaiguaiY  
       17 天前
    相同的问题,我是 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
        28
    sylarc  
    OP
       17 天前
    @YzhucaiguaiY 我这样试过,出现新错误。后来删除 cmt ,正常一次,后来又出错。
    今天更新的 15.2 更新了两个软件没出错,还要再观察。
    autumn426
        29
    autumn426  
       17 天前
    autumn426
        30
    autumn426  
       17 天前
    可以了 M1pro macos15.1.1Homebrew 4.4.11
    sylarc
        31
    sylarc  
    OP
       15 天前
    不是完全确认,我的错误原因大概是 OpenCore-Patcher 破坏了系统 sip 造成的,等下次系统升级再确认,这次不小心又打上了补丁,重启前的升级是正常的
    sylarc
        32
    sylarc  
    OP
       13 天前
    唉,最新情况,系统 15.2 ,有 opencore-pather

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

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

    懵了,与上次出错之间,没再折腾
    littlewing
        33
    littlewing  
       3 天前
    我已经放弃了,Macmini M4 15.2 intel MacBook Pro 15.2 都是一样的问题,不用 brew cask 了
    sylarc
        34
    sylarc  
    OP
       2 天前   ❤️ 1
    @littlewing #33 在用 brew install xxxx --adopt 升级
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   911 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 19:52 · PVG 03:52 · LAX 11:52 · JFK 14:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.