brew install 失败
2021-01-26
2 min read
mac 安装 tesseract
brew install tesseract
失败报错
==> Downloading https://github.com/tesseract-ocr/tessdata_fast/raw/4.0.0/eng.traineddata
######################################################################## 100.0%
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
Error: Failed to download resource "tesseract--eng"
Download failed: https://github.com/tesseract-ocr/tessdata_fast/raw/4.0.0/eng.traineddata
手动curl 或者 browser get OK
代理设置啥的无果
参考一些文档和打印信息后发现下载的都缓存在指定目录下
~/Library/Caches/Homebrew/downloads/
==> Downloading https://github.com/uclouvain/openjpeg/archive/v2.3.1.tar.gz
Already downloaded: /Users/xx/Library/Caches/Homebrew/downloads/e80173a0e76f1052c3d696641bf0a93631ababf780c1aa99ec1d4bd21bbf0e4b--openjpeg-2.3.1.tar.gz
e80173a0e76f1052c3d696641bf0a93631ababf780c1aa99ec1d4bd21bbf0e4b--openjpeg-2.3.1.tar.gz
这个前缀是啥
https://github.com/Homebrew/brew
下载源码查看
ruby写的
# 加密算法 library/homebrew/extend/pathname.rb
def sha256
require "digest/sha2"
Digest::SHA256.file(self).hexdigest
end
# library/homebrew/down_strategy.rb
def cached_location
return @cached_location if defined?(@cached_location)
url_sha256 = Digest::SHA256.hexdigest(url)
downloads = Pathname.glob(HOMEBREW_CACHE/"downloads/#{url_sha256}--*")
.reject { |path| path.extname.end_with?(".incomplete") }
@cached_location = if downloads.count == 1
downloads.first
else
HOMEBREW_CACHE/"downloads/#{url_sha256}--#{resolved_basename}"
end
end
https://www.cmd5.com/hash.aspx?s=123456
测试验证几个URL无误后就OK了
Already downloaded: /Users/xx/Library/Caches/Homebrew/downloads/e9d299931c7904231cdcc678f32df30f903c0a59c45047f7db1304d843ae1136--leptonica-1.80.0.tar.gz
==> Downloading https://github.com/tesseract-ocr/tessdata_fast/raw/4.0.0/eng.traineddata
Already downloaded: /Users/xx/Library/Caches/Homebrew/downloads/43826098cb7f5ea003b3ea7e4cce9d6dc7196455e5e820328293b7a2527d6ea6--eng.traineddata
==> Downloading https://github.com/tesseract-ocr/tessdata_fast/raw/4.0.0/osd.traineddata
######################################################################## 100.0%
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
大爷的,还有其他的