当前位置: 首页 > 工具软件 > Autojump > 使用案例 >

MacOS使用brew无法安装Python_无法安装gdbm_无法安装autojump

乜昆
2023-12-01

GNU 程序国内下载源:https://mirrors.ustc.edu.cn/gnu/

brew 下载的软件安装包存放在下面的目录:

liaowenxiongdeMacBook-Air:Homebrew liaowenxiong$ brew --cache
/Users/liaowenxiong/Library/Caches/Homebrew

出现的问题

liaowenxiong@liaowenxiongdeMacBook-Air ~ % brew install python@3.9

==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/xz-5.2.5.big_sur.bottle.tar.gz
Already downloaded: /Users/liaowenxiong/Library/Caches/Homebrew/downloads/df056a39b092033a98e1f8eeb9ae304920503de32f794a2d8b38ddb269ffb072--xz-5.2.5.big_sur.bottle.tar.gz
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/python%403.9-3.9.6.big_sur.bottle.tar.gz
#=#=#
curl: (22) The requested URL returned error: 404
Warning: Bottle missing, falling back to the default domain...
==> Downloading https://ghcr.io/v2/homebrew/core/python/3.9/manifests/3.9.6
Already downloaded: /Users/liaowenxiong/Library/Caches/Homebrew/downloads/497333c6ca5bfe88a2fd95008a6b111ac766162ed5900db38c7529dbd33e2859--python@3.9-3.9.6.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/python/3.9/blobs/sha256:1397f8fbb9c5858aa02b0177787cb74b8eb0dfede69fc37b64e2787d76baf2fe
Already downloaded: /Users/liaowenxiong/Library/Caches/Homebrew/downloads/61b9364c98374e9c72696bd29cd74442c87414914562620858d90d820caa0071--python@3.9--3.9.6.big_sur.bottle.tar.gz
==> Installing dependencies for python@3.9: gdbm, mpdecimal, sqlite and xz
==> Installing python@3.9 dependency: gdbm
==> Pouring gdbm-1.20.big_sur.bottle.tar.gz
tar: Error opening archive: Failed to open '/Users/liaowenxiong/Library/Caches/Homebrew/downloads/b6c02387c241c721891ec4b1f4e69acca454a147ccb714a9011f2dc0db3412e4--gdbm-1.20.big_sur.bottle.tar.gz'
Error: Failure while executing; `tar --extract --no-same-owner --file /Users/liaowenxiong/Library/Caches/Homebrew/downloads/b6c02387c241c721891ec4b1f4e69acca454a147ccb714a9011f2dc0db3412e4--gdbm-1.20.big_sur.bottle.tar.gz --directory /private/tmp/d20211027-9342-4wr4ku` exited with 1. Here's the output:
tar: Error opening archive: Failed to open '/Users/liaowenxiong/Library/Caches/Homebrew/downloads/b6c02387c241c721891ec4b1f4e69acca454a147ccb714a9011f2dc0db3412e4--gdbm-1.20.big_sur.bottle.tar.gz'

注:安装 autojump 也出现上述的问题。

解决无法安装gbdm的问题

手动下载安装包 gdbm-1.9.tar.gz,下载地址:https://mirrors.ustc.edu.cn/gnu/gdbm/

把安装包 gdbm-1.9.tar.gz 移动到目录 /Users/liaowenxiong/Library/Caches/Homebrew 目录下:

mv gdbm-1.9.tar.gz /Users/liaowenxiong/Library/Caches/Homebrew

然后执行命令:

brew install gdbm

完成安装。

解决无法安装Python的问题

无法安装gdbm,我猜可能不需要上述那种操作,因为貌似是Brew的软件仓库有问题,后来遇到无法安装Python的问题,采取了下面的方式成功解决了。

问题:
下载 https://mirrors.ustc.edu.cn/homebrew-bottles/python%403.9-3.9.6.big_sur.bottle.tar.gz 时,返回 404 错误代码,导致无法正常安装 Python@3.9

解决:
执行命令 brew install Python,这步貌似成功安装了Python3.9,但是好像有些问题
接着执行命令 brew update,更新软件资源库的列表
接着执行命令 brew upgrade,升级所有已安装且有最新版的软件
接着执行命令 brew upgrade Python3.9,提示正常

liaowenxiong@liaowenxiongdeMacBook-Air ~ % brew upgrade python@3.9
Updating Homebrew...
Warning: python@3.9 3.9.7_1 already installed
 类似资料: