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

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

  •  
  •   sylarc · 4 天前 · 1464 次点击

    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 条附言  ·  3 天前

    按照 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

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

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

    https://nosub.net/posts/p/227
    nieyujiang
        15
    nieyujiang  
       3 天前
    执行一下 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
       3 天前
    @nieyujiang 是的,一模一样,求批明方向
    sylarc
        17
    sylarc  
    OP
       3 天前
    @Nosub 我把更新源切换到 github 过,除了变慢了,没有变化
    PhDLuffy
        18
    PhDLuffy  
       3 天前
    路由挂梯子,mac 用全局模式或增强模式,从来没出过错。
    nieyujiang
        19
    nieyujiang  
       3 天前 via iPhone
    @sylarc 一样就不清楚了,之前有遇到过 xattr 命令被某个同名 python 包替换导致功能失效的问题,目前看不是这个问题
    Nosub
        20
    Nosub  
       3 天前 via iPhone
    @sylarc 你没看懂吗,可以离线安装,github 只是 download 安装包,我就是这样安装的。
    Granthese
        21
    Granthese  
       3 天前
    黑苹果?
    sylarc
        22
    sylarc  
    OP
       2 天前
    @nieyujiang #19 虽然我不太明白,我的可能不是这个情况吧,新系统也这样
    sylarc
        23
    sylarc  
    OP
       2 天前
    @Nosub #20 不太明白,我觉得国内镜象最多慢点,不全,应该和官方是一致的吧
    sylarc
        24
    sylarc  
    OP
       2 天前
    @Granthese 黑苹果,翻贴子看,可能与 oclp 有关系,有时间我卸载试试
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1088 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 73ms · UTC 19:08 · PVG 03:08 · LAX 11:08 · JFK 14:08
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.