缘起
看标题以为我要写macOS Ventura 13.2 (22D49)体验,其实不算,春节期间,开了2次电脑,第一次无意间发现download目录下有一个10G的系统升级包,好嘛,昨天中午第二次开机,于是升级一下,生完才发现界面咋 ios 化了, 然后发现这个版本是 2023 年 1 月 23 日(北京时间 24 日凌晨)发布的。
升级前关于本机我记得长这个样子,至少是 4:3 ? 图文不符,忘记截图了。
升级后 9:16,关于本机,直接竖屏模式 ios 化了。
特别是右上角图标和ios没啥差别。
界面问题到此为止。
brew升级问题
这篇的重点其实是 早上敲 ssh 命令时报错了。
1 2 3 4 5 |
ssh 3 dyld[9942]: Library not loaded: /System/Library/Frameworks/Python.framework/Versions/2.7/Python Referenced from: <D11E5BB7-9422-3CF9-BDA6-35FBD959D876> /usr/local/Cellar/openssh/8.1p1/bin/ssh Reason: tried: '/System/Library/Frameworks/Python.framework/Versions/2.7/Python' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/System/Library/Frameworks/Python.framework/Versions/2.7/Python' (no such file), '/System/Library/Frameworks/Python.framework/Versions/2.7/Python' (no such file, not in dyld cache), '/Library/Frameworks/Python.framework/Versions/2.7/Python' (no such file) zsh: abort ssh 3 |
看来和昨天的升级有关,然后继续敲 brew install python3 和 brew -v 等命令,报错相同,如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
brew install python3 Updating Homebrew... Traceback (most recent call last): 11: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `<main>' 10: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `require_relative' 9: from /usr/local/Homebrew/Library/Homebrew/global.rb:29:in `<top (required)>' 8: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' 7: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' 6: from /usr/local/Homebrew/Library/Homebrew/os.rb:3:in `<top (required)>' 5: from /usr/local/Homebrew/Library/Homebrew/os.rb:21:in `<module:OS>' 4: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:58:in `prerelease?' 3: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:24:in `version' 2: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:24:in `new' 1: from /usr/local/Homebrew/Library/Homebrew/os/mac/version.rb:26:in `initialize' /usr/local/Homebrew/Library/Homebrew/version.rb:368:in `initialize': Version value must be a string; got a NilClass () (TypeError) Traceback (most recent call last): |
百分百断定和升级系统有关了。
搜索了一下,说是 Mac 在升级后,之前旧版本的 Homebrew 在新系统不适配。我们直接执行如下命令更新到最新版本的 Homebrew 就可以了,以前升级好像没遇到这个问题呀,估计是这次版本升级跨度有点大。
1 |
brew update-reset |
更新遇到网络问题,网络太差,设代理没啥用,要设Git Remote Mirroring ,参见最后部分。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
brew update-reset ==> Fetching /usr/local/Homebrew... remote: Enumerating objects: 11474, done. remote: Counting objects: 100% (11474/11474), done. Receiving objects: 63% (167918/266535), 121.29 MiB | 30.00 KiB/s error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1) fatal: the remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed ==> Resetting /usr/local/Homebrew... Updating files: 100% (5430/5430), done. 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'. ==> Fetching /usr/local/Homebrew/Library/Taps/esolitos/homebrew-ipa... /usr/local/Homebrew/Library/Homebrew/brew.sh: line 67: /usr/local/Homebrew/Library/Homebrew/shims/scm/git: No such file or directory ==> Resetting /usr/local/Homebrew/Library/Taps/esolitos/homebrew-ipa... /usr/local/Homebrew/Library/Homebrew/brew.sh: line 67: /usr/local/Homebrew/Library/Homebrew/shims/scm/git: No such file or directory ==> Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core... /usr/local/Homebrew/Library/Homebrew/brew.sh: line 67: /usr/local/Homebrew/Library/Homebrew/shims/scm/git: No such file or directory ==> Resetting /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core... /usr/local/Homebrew/Library/Homebrew/brew.sh: line 67: /usr/local/Homebrew/Library/Homebrew/shims/scm/git: No such file or directory |
然后跑brew命令开始报错,索性重装一下。
1 |
zsh: command not found: brew |
参考这篇重装 brew 并配置环境变量 (m1芯片的mac才需要配置环境变量,原x86的不需要)
1 2 |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" |
1 2 |
echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> /Users/"YOUR USER NAME"/.zprofile |
1 |
eval $(/opt/homebrew/bin/brew shellenv) |
brew update 更新完成截图
ssh问题
后来发现 ssh 报错, dyld[9942]: Library not loaded: /System/Library/Frameworks/Python.framework/Versions/2.7/Python 原因是需要重装 python 2.7
https://liam.page/en/2022/04/01/fix-missing-Python2-7-on-macOS-Monterey-12-3/
According to Apple's release note, Python 2.7 has been removed since macOS Monterey 12.3. This is the reason of the crashes. Considering that some of the latest version of these Apps still depend on Python 2.7, we'll have to install it manually. Python 2.7.18 could be found at the official site of Python. Download and install it, and these crashes shall then be fixed.
安装了这个 2.7.18 的 pkg 包后,ssh 登录命令终于正常了。
Congratulations! Python 2.7.18 for macOS 10.9 or later was successfully installed.
另外 brew -v 查看版本也有输出了, 版本够新的。
1 2 3 4 |
brew -v Homebrew 3.6.20-143-g10845a1 Homebrew/homebrew-core (git revision 7bc78a0f4ef; last commit 2023-01-28) Homebrew/homebrew-cask (git revision 10845a1122; last commit 2023-01-27) |
tips
安装brew 网络慢的,强烈建议参考 https://docs.brew.sh/Installation 官网,加上 Git Remote Mirroring 的国内镜像
直接用清华源即可 https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/
1 2 3 |
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git" export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git" export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles" |
文章评论